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

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Mon Jun 8 12:59:10 EDT 2009


Author: ozizka at redhat.com
Date: 2009-06-08 12:59:10 -0400 (Mon, 08 Jun 2009)
New Revision: 513

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
EarTest#testEarRedeployDifferentVersion() 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-08 15:46:19 UTC (rev 512)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java	2009-06-08 16:59:10 UTC (rev 513)
@@ -1156,34 +1156,38 @@
 
 
 
+	/**
+	 *  Deploys an EAR, then re-deploys (Content tab) EAR with the same name, but different content.
+	 */
 	public void testEarRedeployDifferentVersion() throws IOException, EmbJoprTestException
 	{
 
 		final String DEPLOYABLE_NAME  = EAR_WITH_WAR_COUNTER;
-		final String DEPLOYABLE_NAME2 = EAR_WITH_WAR_COUNTER_20;
+		final String DEPLOYABLE_NAME_2 = EAR_WITH_WAR_COUNTER_20;
 
-		// Copy new version to tmp dir under old ver's filename.
-		String srcFilePath =  ejtt.getTestDataDir() +"/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME2;
-		String destFilePath = ejtt.getTempDir() +"/"+DEPLOYABLE_NAME;
-		FileUtils.copyFile(new File(srcFilePath), new File(destFilePath));
 
-
-		// Deploy the EAR.
-		String appFilePath = destFilePath;
-		ejtt.deployment.deployViaEmbJopr( APP_TYPE, appFilePath );
-
-		String appFilePath2 = ejtt.getTestDataDir() + "/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME2;
-
 		try {
 
+			// Deploy the first EAR.
+			String appFilePath = ejtt.getTestDataDir() +"/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME;
+			ejtt.deployment.deployViaEmbJopr( APP_TYPE, appFilePath );
+
 			ejtt.getNavTree().getNodeByLabel(NAV_EAR).click();
 			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME, 3000, 15);
 
+
+			// Copy new version to tmp dir under old ver's filename.
+			String srcFilePath =  ejtt.getTestDataDir() +"/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME_2;
+			String destFilePath = ejtt.getTempDir() +"/"+DEPLOYABLE_NAME;
+			FileUtils.copyFile(new File(srcFilePath), new File(destFilePath));
+			String appFilePath2 = destFilePath;
+
 			// Navigate to the Configuration tab
 			ContentTableRow earRow = ejtt.getDefaultContentTable().getFirstRowContainingLink(DEPLOYABLE_NAME);
 			earRow.getLinkByLabel(DEPLOYABLE_NAME).click();
 			ejtt.tabMenu.clickContentTab();
 
+			// Deploy the second version
 			String xPath = ".//table//input[@type='file']";
 			HtmlFileInput fileInput = ejtt.tabMenu.getTabContentBox().getElement().getFirstByXPath(xPath);
 			fileInput.setValueAttribute(appFilePath2);
@@ -1194,9 +1198,8 @@
 			// We should get:
 			// The specified file must have the same name as the existing
 			// deployed EAR File (EarWithWar-Counter.ear).
-			String msg = "The specified file must have the same name " +
-				"as the existing deployed EAR File";
-			checkClientAndServerMessages( msg, msg, FacesMessage.SEVERITY_WARN );
+			String msg = "EAR File "+DEPLOYABLE_NAME+" updated.";
+			checkClientAndServerMessages( msg, msg, FacesMessage.SEVERITY_INFO );
 
 			// Check that the old app is deployed.
 			ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME, 3000, 15);
@@ -1208,11 +1211,6 @@
 			}catch( Exception ex ){
 				log.error("Caught exception when undeploying: "+ex, ex);
 			}
-			try {
-				undeployEar( DEPLOYABLE_NAME2 );
-			}catch( Exception ex ){
-				log.error("Caught exception when undeploying: "+ex, ex);
-			}
 		}
 
 	}




More information about the embjopr-commits mailing list