[embjopr-commits] EMBJOPR SVN: r497 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Thu Jun 4 14:07:45 EDT 2009


Author: ozizka at redhat.com
Date: 2009-06-04 14:07:45 -0400 (Thu, 04 Jun 2009)
New Revision: 497

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
EarTest updated

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java	2009-06-04 17:31:52 UTC (rev 496)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java	2009-06-04 18:07:45 UTC (rev 497)
@@ -422,44 +422,10 @@
 
 		// Deploy the EAR
 		String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
-		//deployEar( earFilePath );
 		ejtt.deployment.deployViaEmbJopr(APP_TYPE, earFilePath);
 
 		try {
 
-			/*
-			// Wait until the EAR appears...
-			new ActiveConditionChecker(new DescribedCondition("EAR appears in Summary tab list") {
-				public boolean isTrue() throws Exception {
-					// Refresh, then check.
-					ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
-					ContentTableRow earRow = ejtt.getDefaultContentTable().findFirstRowContainingLink(BASIC_EAR);
-					return null != earRow;
-				}
-			}).dumpPageOnTimeout(this).throwOnTimeout().waitWithTimeout(2000, 10);
-
-
-			ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_EAR);
-
-			// Wait until the Status is "UP".
-			// TODO: Replace with ActiveConditionChecker.
-			int maxLoops = DEPLOY_TIMEOUT_SEC;
-			do {
-				String statusText = earRow.getCellTextByColumnName("Status");
-				log.debug("EAR Status: "+statusText);
-				if( "UP".equals(statusText) )
-					break;
-
-				// Refresh page after 1 second.
-				ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
-				earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_EAR);
-
-				// We don't want an infinite loop by mistake.
-				if( maxLoops-- <= 0 ){
-					throw new EmbJoprTestException("EAR "+BASIC_EAR+" not UP after "+DEPLOY_TIMEOUT_SEC+" seconds.");
-				}
-			} while( true );
-			 /**/
 			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME, 2000, 10);
 
 			// FAILS because of EMBJOPR-80.
@@ -524,7 +490,7 @@
 		try {
 
 			ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, BASIC_EAR, 3000, 15);
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, BASIC_EAR, 3000, 15);
 
 			// Navigate to the Configuration tab
 			ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_EAR);
@@ -586,7 +552,7 @@
 		try {
 
 			ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, BASIC_EAR, 3000, 15);
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, BASIC_EAR, 3000, 15);
 
 			// Navigate to the Configuration tab
 			ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_EAR);
@@ -643,13 +609,13 @@
 		final String DEPLOYABLE_NAME  = BASIC_EAR;
 
 		// Deploy the EAR.
-		String appFilePath = ejtt.getTestDataDir() + "/"+DeployableTypes.EAR.getDataDir()+"/"+DEPLOYABLE_NAME;
+		String appFilePath = ejtt.getTestDataDir() + "/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME;
 		deployEar( appFilePath );
 
 		try {
 
 			ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, DEPLOYABLE_NAME, 3000, 15);
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME, 3000, 15);
 
 			// Navigate to the Configuration tab
 			ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(DEPLOYABLE_NAME);
@@ -692,7 +658,7 @@
 		try {
 			// Wait for EAR to be deployed and UP
 			ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, BASIC_EAR, 3000, 15);
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, BASIC_EAR, 3000, 15);
 
 			ContentTable table = ejtt.getTabMenu().getTabContentBox().getTableUnderHeader("Resource Traits");
 			ContentInfoTable infoTable = ejtt.getTabMenu().getTabContentBox().getContentInfoTable(table.getElement());
@@ -873,7 +839,7 @@
 
 			// Wait until the EAR is UP.
 			ejtt.getNavTree().getNodeByLabel(APP_TYPE.getNavTreeLabel()).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, DEPLOYABLE_NAME, 3000, 30, this);
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME, 3000, 30, this);
 			
 			// Assert that the app is running.
       page = (HtmlPage)webClient.getPage(testPageUrl);
@@ -905,7 +871,7 @@
 	 * Was failing because of EMBJOPR-133.
 	 * Now FAILS because of EMBJOPR-172.
 	 */
-	public void testStopAndStartEar() throws IOException, EmbJoprTestException
+	public void testEarStopAndStart() throws IOException, EmbJoprTestException
 	{
 		final String DEPLOYABLE_NAME = EAR_WITH_WAR_COUNTER;
 
@@ -929,8 +895,8 @@
 		try {
 
 			// Wait until app is UP
-			ejtt.getNavTree().getNodeByLabel(DeployableTypes.EAR.getNavTreeLabel()).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, DEPLOYABLE_NAME,
+			ejtt.getNavTree().getNodeByLabel(APP_TYPE.getNavTreeLabel()).click();
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME,
 							3000, 15, this);
 
 			// Assert that the app is running.
@@ -969,25 +935,7 @@
 
 			// Click the Start button.
 			ejtt.tabMenu.getTabContentBox().getButtonByLabel("Start").click();
-
-			// Check the latest message. TODO: EJTT class for ops history table?
-			//DebugUtils.writeFile("target/testStopAndStartEar-opsTable2.html", client.getPageAsText() );///
-			//status = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getLastOperationStatus();
-			//assertEquals("Start operation did not succeed, the status is: "+status, OperationStatusType.SUCCESS, status);
-			//assertTrue( ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
-			/*try {
-				new ActiveConditionChecker( new DescribedCondition("Start operation status changes from 'In Progreess'.") {
-					int calls = 0;
-					public boolean isTrue() throws Exception {
-						if( ++calls > 1 ) ((HtmlPage)client.getContentPage()).refresh();
-						OperationStatusType status = ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getLastOperationStatus();
-						return ! OperationStatusType.IN_PROGRESS.equals( status );
-					}
-				}).dumpPageOnTimeout(this).throwOnTimeout().waitWithTimeout(1500, 5);
-			}
-			catch(Exception ex){
-				throw new EmbJoprTestException(ex.getMessage(), ex.getCause());
-			}/**/
+			// Check the latest message.
 			ejtt.operations.waitActivelyForOperationToFinish("Start", 1500, 5);
 
 
@@ -1019,7 +967,7 @@
 	 *
 	 * FAILS because of EMBJOPR-133.
 	 */
-	public void testRestartEar() throws IOException, EmbJoprTestException
+	public void testEarRestart() throws IOException, EmbJoprTestException
 	{
 		final String DEPLOYABLE_NAME = EAR_WITH_WAR_COUNTER;
 
@@ -1042,8 +990,8 @@
 		try {
 
 			// Wait until app is UP
-			ejtt.getNavTree().getNodeByLabel(DeployableTypes.EAR.getNavTreeLabel()).click();
-			ejtt.deployment.waitActivelyForDeployment(DeployableTypes.EAR, DEPLOYABLE_NAME,
+			ejtt.getNavTree().getNodeByLabel(APP_TYPE.getNavTreeLabel()).click();
+			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME,
 							3000, 15, this);
 
 			// Assert that the app is running.




More information about the embjopr-commits mailing list