[embjopr-commits] EMBJOPR SVN: r540 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5: scripts and 1 other directory.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Wed Jun 17 17:00:34 EDT 2009


Author: ozizka at redhat.com
Date: 2009-06-17 17:00:33 -0400 (Wed, 17 Jun 2009)
New Revision: 540

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java
Log:
ScriptTest updated.

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java	2009-06-17 20:37:08 UTC (rev 539)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java	2009-06-17 21:00:33 UTC (rev 540)
@@ -56,9 +56,13 @@
 	/**
 	 * Changes "Active Binding Set Name" property in the Conf tab, saves,
 	 * and then changes back to original.
+	 * TODO: "Server restart needed" - see JOPR-230.
 	 */
 	public void testServiceBindingManagerConfigurationTest() throws IOException, EmbJoprTestException	{
 
+		final String PROPERTY_activeBindingSetName = "activeBindingSetName";
+
+
 		// Go to Service Binding Managers node.
 		ejtt.navTree.getNodeByLabel(NAV_SBM).click();
 
@@ -71,7 +75,7 @@
 		//ejtt.tabMenu.getTabContentBox().getFirstTable().getFirstRowContainingText("")
 		Properties props = new Properties();
 		// Carefully - setting this to non-existent leads to disfunctional AS! See
-		props.setProperty("activeBindingSetName", "ports-01");
+		props.setProperty(PROPERTY_activeBindingSetName, "ports-01");
 		fillOutForm(props);
 
 		ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("Save").click();
@@ -88,7 +92,7 @@
 		//ejtt.tabMenu.getTabContentBox().getFirstTable().getFirstRowContainingText("")
 		props = new Properties();
 		// Carefully - setting this to non-existent leads to disfunctional AS! See
-		props.setProperty("activeBindingSetName", "ports-default");
+		props.setProperty(PROPERTY_activeBindingSetName, "ports-default");
 		fillOutForm(props);
 
 		ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("Save").click();

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java	2009-06-17 20:37:08 UTC (rev 539)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/scripts/ScriptsTest.java	2009-06-17 21:00:33 UTC (rev 540)
@@ -3,6 +3,8 @@
 import com.gargoylesoftware.htmlunit.Page;
 import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
 import com.gargoylesoftware.htmlunit.html.HtmlDivision;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
 import com.gargoylesoftware.htmlunit.html.HtmlTable;
 import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
 import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
@@ -164,6 +166,8 @@
 	}
 
 
+
+	
 	/**
 	 * Runs the classpath.sh script, without parameters.
 	 */
@@ -179,8 +183,19 @@
 			ejtt.tabMenu.clickControlTab();
 			// Execute the script.
 			ejtt.tabMenu.getTabContentBox().getButtonByLabel(EXECUTE_OP_NAME).click();
+
 			// Command Line Arguments - none
-			ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("OK").click();
+			//ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("OK").click();
+			// No tabs here.
+			// (22:50:51) ozizka: ccrouch, ips: After clicking "Execute Script", the Control Operation page (the one where I set the arguments) doesn't have the tabs. All other pages have tabs. Is this intentional?
+			// (22:52:49) ips: ozizka: yeah probably intentional to show you're in the middle of a workflow
+			// (22:52:55) ips: ideally we should switch it over to using a modal on the original page for prompting for the params
+			/*String label = "OK";
+			HtmlInput okButton = ((HtmlDivision) client.getElement("content")).getFirstByXPath(".//input[normalize-space(@value)='" + label + "']");
+			okButton.click();*/
+			((HtmlSubmitInput) client.getElement("parametersForm:okButton")).click();
+
+
 			// Wait for the operation to succesfuly finish.
 			ejtt.operations.waitActivelyForOperationToFinish(EXECUTE_OP_NAME, 5000, 5);
 			assertTrue(EXECUTE_OP_NAME+" operation wasn't successful.", ejtt.tabMenu.getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
@@ -230,7 +245,7 @@
 
 
 	/**
-	 * Runs the classpath.sh script, without parameters.
+	 * Runs `classpath.sh -c`, which prints the classpath.
 	 */
 	public void testScriptsRunClasspathshWithParamTest() throws IOException, EmbJoprTestException {
 
@@ -254,7 +269,9 @@
 			argsTA.setText("-c");
 
 			// Run.
-			ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("OK").click();
+			//ejtt.tabMenu.getTabContentBox().getSubmitButtonByLabel("OK").click();
+			((HtmlSubmitInput) client.getElement("parametersForm:okButton")).click();
+
 			// Wait for the operation to succesfuly finish.
 			ejtt.operations.waitActivelyForOperationToFinish(EXECUTE_OP_NAME, 5000, 5);
 			assertTrue(EXECUTE_OP_NAME+" operation wasn't successful.", ejtt.tabMenu.getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
@@ -278,7 +295,7 @@
 
 			String expectedOutputPart = "/client";
 			HtmlTextArea outputTA = resultsTable.getFirstRowContainingText("Output").getCellByColumnName("Value").getFirstByXPath(".//textarea");
-			assertTrue("classpath.sh parameter-less run output should contain '"+expectedOutputPart+"'", outputTA.getText().toLowerCase().contains(expectedOutputPart));
+			assertTrue("`classpath.sh -c` run output should contain '"+expectedOutputPart+"'", outputTA.getText().toLowerCase().contains(expectedOutputPart));
 
 		}
 		finally {




More information about the embjopr-commits mailing list