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

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Wed Apr 15 13:04:18 EDT 2009


Author: ozizka at redhat.com
Date: 2009-04-15 13:04:18 -0400 (Wed, 15 Apr 2009)
New Revision: 289

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
Log:
Added testEarWithUnsatisfiedDeps() test case.

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java	2009-04-14 21:04:48 UTC (rev 288)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java	2009-04-15 17:04:18 UTC (rev 289)
@@ -126,6 +126,7 @@
 		public static final String EAR_UNPACKED_ZIP = "unpacked-ear1.ear.zip";
 		public static final String EAR_WITH_WAR = "EarWithWarNB.ear";
 		public static final String EAR_WITH_WAR_COUNTER = "EarWithWar-Counter.ear";
+		public static final String EAR_EXT_DEPENDENCIES = "EarExtDependencies.ear";
 
 		// WAR
     public static final String BASIC_WAR = "hellothere.war";


Property changes on: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5
___________________________________________________________________
Name: svn:ignore
   - Ejb30Test.java
JMXUtilsAS5.java

   + ProfileServiceTest.java
Ejb30Test.java
JMXUtilsAS5.java


Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java	2009-04-14 21:04:48 UTC (rev 288)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java	2009-04-15 17:04:18 UTC (rev 289)
@@ -31,6 +31,7 @@
 import java.util.*;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
+import javax.faces.application.FacesMessage;
 import javax.faces.context.FacesContext;
 import javax.servlet.http.HttpServletRequest;
 import junit.framework.Test;
@@ -96,27 +97,29 @@
 	public void XtestBasicEarDeployment() throws IOException, EmbJoprTestException
 	{
 
+		final String DEPLOYABLE_NAME = BASIC_EAR;
+
 		try {
 			// Deploy the EAR.
-			String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) + "/ear/"+BASIC_EAR;
+			String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
 			deployEar( earFilePath );
 
-			String expectedMessage = BASIC_EAR + " created successfully";
+			String expectedMessage = DEPLOYABLE_NAME + " created successfully";
 
 			checkClientAndServerMessages(expectedMessage, expectedMessage, false);
 
 			// Use JMX to assert that the EAR components really did deploy successfully.
 			//id="vfszip:/home/brq/ozizka/JoprEmbedded/jboss-as-5.x/build/output/jboss-5.1.0.Beta1/server/default/deploy/eardeployment.ear/",type=Deployment
 			//id="vfszip:/home/ondra/work/JOPRembedded/embjopr-svn-trunk/jsfunit/target/jboss5x/deploy/eardeployment.ear",* not found.
-			assertTrue("JMX doesn't report EAR as deployed: eardeployment.ear", isEarDeployed(BASIC_EAR));
+			assertTrue("JMX doesn't report EAR as deployed: eardeployment.ear", isEarDeployed(DEPLOYABLE_NAME));
 			assertTrue("JMX doesn't report EJB sessiona.jar as deployed.", isEJBDeployed("sessiona.jar"));
 			assertTrue("JMX doesn't report EJB sessionb.jar as deployed.", isEJBDeployed("sessionb.jar"));
 		}
 		finally {
 			// Undeploy the EAR.
-			undeployEar( BASIC_EAR );
+			undeployEar( DEPLOYABLE_NAME );
 
-			String expectedMessage = "Successfully deleted Enterprise Application (EAR) '"+BASIC_EAR+"'.";
+			String expectedMessage = "Successfully deleted Enterprise Application (EAR) '"+DEPLOYABLE_NAME+"'.";
 			assertTrue(client.getPageAsText().contains( expectedMessage ));
 		}
 
@@ -936,13 +939,43 @@
 
 
 
+	/**
+	 * Deploys an EAR with dependencies which are not in default config,
+	 * checks for the deployment error message,
+	 * and checks that the EAR is not listed.
+	 *
+	 * FAILS because of EMBJOPR-137 - EAR with unsatisfied dependencies
+	 * show error upon deploy, but then shows as UP.
+	 */
+	public void testEarWithUnsatisfiedDeps() throws IOException, EmbJoprTestException
+	{
 
+		final String DEPLOYABLE_NAME = EAR_EXT_DEPENDENCIES;
 
+		try {
+			// Deploy the EAR.
+			String appFilePath = ejtt.getTestDataDir() + "/"+DeployableTypes.EAR.getDataDir()+"/"+DEPLOYABLE_NAME;
+			ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, appFilePath );
 
+			// Check that we get an error message.
+			assertTrue( "We should get an error message.", server.getFacesMessages().hasNext() );
+			assertTrue( "We should get an error message.",
+							server.getFacesMessages().next().getSeverity() != FacesMessage.SEVERITY_INFO );
 
+			// Check that the EAR is not listed as deployed.
+			assertFalse( "The EAR should not be listed as deployed.",
+		    ejtt.deployment.isDeployedAccordingToEmbJopr(DeployableTypes.EAR, DEPLOYABLE_NAME, false) );
 
+		}
+		finally {
+			// Undeploy the EAR.
+			undeployEar( DEPLOYABLE_NAME );
 
+			String expectedMessage = "Successfully deleted Enterprise Application (EAR) '"+DEPLOYABLE_NAME+"'.";
+			assertTrue(client.getPageAsText().contains( expectedMessage ));
+		}
 
+	}
 
 
 
@@ -952,6 +985,14 @@
 
 
 
+
+
+
+
+
+
+
+
 	/**
 	 * Waits for the deployable to be in the UP State.
 	 *




More information about the embjopr-commits mailing list