[embjopr-commits] EMBJOPR SVN: r436 - 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 May 18 11:23:20 EDT 2009


Author: ozizka at redhat.com
Date: 2009-05-18 11:23:19 -0400 (Mon, 18 May 2009)
New Revision: 436

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
EarTest - testEarDeploymentRepeated() added.

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-05-18 14:40:39 UTC (rev 435)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java	2009-05-18 15:23:19 UTC (rev 436)
@@ -98,7 +98,7 @@
 	 *	Add a new resource.  Verify the resource was successfully
 	 *	deployed.  Undeploy the archive for test clean up purposes.
 	 *
-	 * FAILED: JMX doesn't report EAR as deployed: eardeployment.ear
+	 * Was failing: JMX doesn't report EAR as deployed: eardeployment.ear
 	 */ 
 	public void testBasicEarDeployment() throws IOException, EmbJoprTestException
 	{
@@ -139,7 +139,46 @@
 
 	}
 
+
+
 	/**
+	 * Test aimed to reveal potential memory leak.
+	 * Can take very long.
+	 */
+	public void testEarDeploymentRepeated() throws IOException, EmbJoprTestException
+	{
+		final String DEPLOYABLE_NAME = BASIC_EAR;
+		int TURNS = 100;
+
+		try {
+			for (int i = TURNS; i > 0; i--) {
+				log.info("Remaining EAR deploys: "+i);
+				// Deploy the EAR.
+				String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
+				deployEar( earFilePath );
+				String expectedMessage = DEPLOYABLE_NAME + " created successfully";
+				checkClientAndServerMessages(expectedMessage, expectedMessage, false);
+				// Undeploy the EAR.
+				ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
+			}
+		}
+		finally {
+			try {
+				// Undeploy the EAR.
+				ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
+			}catch( EmbJoprTestException ex ){
+				// Expected to fail - EAR should be undeployed if everything goes well.
+				log.debug("Expected exception - "+ex.getMessage());
+			}
+		}
+
+	}
+
+
+
+
+	
+	/**
 	 *	assertion:
 	   
 	      Verify an .ear that contained a bad deployment descriptor
@@ -154,7 +193,7 @@
 				verify the archive has been deployed successfully.
 	 
 	 */
-	public void DISABLEDtestBadEarRedeploy() throws IOException, HtmlElementNotFoundException, ActionNotAvailableException {
+	public void testBadEarRedeploy() throws IOException, HtmlElementNotFoundException, ActionNotAvailableException {
 
 		try {
 			String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) + "/ear/"+EAR_MALFORMED_APP_FILENAME;




More information about the embjopr-commits mailing list