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

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Mon Apr 27 15:43:47 EDT 2009


Author: ozizka at redhat.com
Date: 2009-04-27 15:43:47 -0400 (Mon, 27 Apr 2009)
New Revision: 358

Added:
   trunk/jsfunit/testdata/war/hellothere10.war
Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java
Log:
Updated EAR and WAR tests.
Added WarTest#testStandaloneWarDoesntAppearInEmbeddedWars().

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-27 19:05:14 UTC (rev 357)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java	2009-04-27 19:43:47 UTC (rev 358)
@@ -41,15 +41,15 @@
 		 */
 		public enum DeployableTypes {
 
-			// Mandatory: first, fourth
 			// Nav tree link label, testdata/$dir, extension, suffix, mime type.
-			EAR(AppConstants.NAV_EAR,   "ear",   ".ear", null, "application/ear"),
-			WAR(AppConstants.NAV_WAR,   "war",   ".war", null, "application/war"),
-			EJB2(AppConstants.NAV_EJB2, "ejb2",  ".jar", null, "	application/java-archive"),
-			EJB3(AppConstants.NAV_EJB3, "ejb3",  ".jar", null, "	application/java-archive"),
+			EAR(AppConstants.NAV_EAR,   "ear",   ".ear", null,  "application/ear"),
+			WAR(AppConstants.NAV_WAR,   "war",   ".war", null,  "application/war"),
+			EJB2(AppConstants.NAV_EJB2, "ejb2",  ".jar", null,  "application/java-archive"),
+			EJB3(AppConstants.NAV_EJB3, "ejb3",  ".jar", null,  "application/java-archive"),
 			SAR(AppConstants.NAV_SAR,   "sar",   ".sar", "-service.xml", "application/sar"),
-			RAR(AppConstants.NAV_RAR,   "rar",   ".rar", null, "application/rar"),
-			MC_BEAN(AppConstants.NAV_MC, "mc", "",    null, "application/java-archive");
+			RAR(AppConstants.NAV_RAR,   "rar",   ".rar", null,   "application/rar"),
+			MC_BEAN(AppConstants.NAV_MC, "mc",   "",     null,   "application/java-archive"),
+			EMB_WAR(AppConstants.NAV_EMB_WAR,"",".war", null, "application/war");
 
 			// -- Fields --
 
@@ -111,6 +111,7 @@
     public static final String NAV_PAR = "Persistence Unit (PAR)s";
     public static final String NAV_RAR = "Resource Adaptor (RAR)s";
     public static final String NAV_WAR = "Web Application (WAR)s";
+    public static final String NAV_EMB_WAR = "Embedded Web Application (WAR)s";
 
 		public static final String EAR_MALFORMED_APP_FILENAME = "malformed-application-xml.ear";
 		public static final String WAR_FILENAME_MALFORMED_APP = "malformed-web-xml.war";
@@ -141,6 +142,7 @@
     public static final String BASIC_WAR_07 = "hellothere07.war";
     public static final String BASIC_WAR_08 = "hellothere08.war";
     public static final String BASIC_WAR_09 = "hellothere09.war";
+    public static final String BASIC_WAR_10 = "hellothere10.war";
     public static final String BASIC_WAR_DUD = "hellothere-DUD.war";
     public static final String BASIC_WAR_DUD_RETRY = "hellothere-DUD_RETRY.war";
     public static final String BASIC_WAR_STOPSTART = "hellothere-STOP_START.war";

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-27 19:05:14 UTC (rev 357)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java	2009-04-27 19:43:47 UTC (rev 358)
@@ -844,7 +844,7 @@
 
 			// Assert that the app is stopped.
       page = (HtmlPage)webClient.getPage(testPageUrl);
-			assert( 200 != page.getWebResponse().getStatusCode() );
+			assertTrue( 200 != page.getWebResponse().getStatusCode() );
 
 
 			// Click the Start button.
@@ -864,7 +864,7 @@
 
 			// Assert that the app is running.
       page = (HtmlPage)webClient.getPage(testPageUrl);
-			assert( 200 == page.getWebResponse().getStatusCode() );
+			assertTrue( 200 == page.getWebResponse().getStatusCode() );
       assertTrue(page.asText().contains("HELLO WORLD"));
 
 			// Get the counter number.
@@ -952,7 +952,7 @@
 
 			// Assert that the app is running.
       page = (HtmlPage)webClient.getPage(testPageUrl);
-			assert( 200 == page.getWebResponse().getStatusCode() );
+			assertTrue( 200 == page.getWebResponse().getStatusCode() );
       assertTrue(page.asText().contains("HELLO WORLD"));
 
 			// Get the counter number.

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java	2009-04-27 19:05:14 UTC (rev 357)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java	2009-04-27 19:43:47 UTC (rev 358)
@@ -901,7 +901,7 @@
 
 			// Assert that the app is stopped.
       page = (HtmlPage)webClient.getPage(testPageUrl);
-			assert( 200 != page.getWebResponse().getStatusCode() );
+			assertTrue( 200 != page.getWebResponse().getStatusCode() );
 
 
 			// Click the Start button.
@@ -918,7 +918,7 @@
 
 			// Assert that the app is running.
       page = (HtmlPage)webClient.getPage(testPageUrl);
-			assert( 200 == page.getWebResponse().getStatusCode() );
+			assertTrue( 200 == page.getWebResponse().getStatusCode() );
       assertTrue(page.asText().contains("HELLO WORLD"));
 
 			// Get the counter number.
@@ -1062,16 +1062,42 @@
 
 
 
+	public void testStandaloneWarDoesntAppearInEmbeddedWars() throws IOException, EmbJoprTestException
+	{
+		final String DEPLOYABLE_NAME = BASIC_WAR_10;
 
 
+		// Deploy the WAR.
+		String appFilePath = ejtt.getTestDataDir() + "/war/"+DEPLOYABLE_NAME;
 
+		try {
+			
+			deployWAR( appFilePath );
 
+			ejtt.navTree.getNodeByLabel(DeployableTypes.EMB_WAR.getNavTreeLabel()).getLabelLink().click();
 
+			assertFalse( ejtt.deployment.isDeployedAccordingToEmbJopr(DeployableTypes.EMB_WAR, DEPLOYABLE_NAME, false) );
 
+		}
+		finally {
+			// Undeploy for the case it was (errorneously) deployed.
+			try {
+				undeployWAR(DEPLOYABLE_NAME);
+			} catch( Exception ex ){
+				log.debug("Cathed an expected exception when trying to undeploy "+DEPLOYABLE_NAME+": "+ex );
+			}
+		}
+	}
 
 
 
 
+
+
+
+
+
+
 	/**
 	 * Deploys WAR.
 	 */

Added: trunk/jsfunit/testdata/war/hellothere10.war
===================================================================
(Binary files differ)


Property changes on: trunk/jsfunit/testdata/war/hellothere10.war
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the embjopr-commits mailing list