[jboss-cvs] JBossAS SVN: r60684 - in branches/Branch_4_2/testsuite: src/main/org/jboss/test/deployment/earlib/services and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 19 18:03:46 EST 2007


Author: scott.stark at jboss.org
Date: 2007-02-19 18:03:46 -0500 (Mon, 19 Feb 2007)
New Revision: 60684

Modified:
   branches/Branch_4_2/testsuite/imports/sections/deployers.xml
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibService.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/test/EARLibUnitTestCase.java
   branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-custom.xml
   branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-implicit.xml
   branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-nolib.xml
   branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml
Log:
JBAS-4037, Expand the ear library-directory tests

Modified: branches/Branch_4_2/testsuite/imports/sections/deployers.xml
===================================================================
--- branches/Branch_4_2/testsuite/imports/sections/deployers.xml	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/imports/sections/deployers.xml	2007-02-19 23:03:46 UTC (rev 60684)
@@ -314,6 +314,7 @@
    	</jar>
 
       <!-- custom ear lib directory ear -->
+   	<echo message="earlib-custom.ear" />
       <ear destfile="${build.lib}/earlib-custom.ear"
          appxml="${build.resources}/deployment/earlib/application.xml"
          update="true">
@@ -327,6 +328,10 @@
             <include name="earlib.jar"/>
          </zipfileset>
       </ear>
+   	<echo message="unpacked-earlib-custom.ear" />
+   	<mkdir dir="${build.lib}/unpacked-earlib-custom.ear"/>
+      <unzip dest="${build.lib}/unpacked-earlib-custom.ear"
+   		src="${build.lib}/earlib-custom.ear" />
 
       <!-- implicit ear lib directory ear -->
       <ear destfile="${build.lib}/earlib-implicit.ear"
@@ -342,6 +347,10 @@
             <include name="earlib.jar"/>
          </zipfileset>
       </ear>
+   	<echo message="unpacked-earlib-implicit.ear" />
+   	<mkdir dir="${build.lib}/unpacked-earlib-implicit.ear"/>
+      <unzip dest="${build.lib}/unpacked-earlib-implicit.ear"
+   		src="${build.lib}/earlib-implicit.ear" />
 
    	<!-- no ear lib directory ear -->
       <ear destfile="${build.lib}/earlib-nolib.ear"

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibService.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibService.java	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibService.java	2007-02-19 23:03:46 UTC (rev 60684)
@@ -25,9 +25,10 @@
  * A service that tests classes found in an ear lib
  * 
  * @author Scott.Stark at jboss.org
- * @version $Revision:$
+ * @version $Revision$
  */
 public class LibService
+   implements LibServiceMBean
 {
    public boolean loadClass(String name) throws ClassNotFoundException
    {


Property changes on: branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibService.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/test/EARLibUnitTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/test/EARLibUnitTestCase.java	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/test/EARLibUnitTestCase.java	2007-02-19 23:03:46 UTC (rev 60684)
@@ -38,6 +38,12 @@
       super(name);
    }
 
+   /**
+    * Validate that the earlib-custom.ear/custom-lib jars are added to
+    * the ear classpath.
+    * 
+    * @throws Exception
+    */
    public void testEarLibCustom() throws Exception
    {
       getLog().debug("+++ testEarLibCustom");
@@ -46,7 +52,7 @@
          deploy("earlib-custom.ear");
          ObjectName name = new ObjectName("jboss.test:name=libService");
          String[] sig = {String.class.getName()};
-         Object[] args = {"org.jboss.test.deployers.earlib.util.EarLibClass"};
+         Object[] args = {"org.jboss.test.deployment.earlib.util.EarLibClass"};
          Boolean ok = (Boolean) super.invoke(name, "loadClass", args, sig);
          assertTrue("loadClass was ok", ok.booleanValue());
       }
@@ -61,5 +67,122 @@
       }
       
    }
+   /**
+    * Validate that the unpacked-earlib-custom.ear/custom-lib jars are added
+    * to the ear classpath.
+    * 
+    * @throws Exception
+    */
+   public void testUnpackedEarLibCustom() throws Exception
+   {
+      getLog().debug("+++ testUnpackedEarLibCustom");
+      try
+      {
+         deploy("unpacked-earlib-custom.ear");
+         ObjectName name = new ObjectName("jboss.test:name=libService");
+         String[] sig = {String.class.getName()};
+         Object[] args = {"org.jboss.test.deployment.earlib.util.EarLibClass"};
+         Boolean ok = (Boolean) super.invoke(name, "loadClass", args, sig);
+         assertTrue("loadClass was ok", ok.booleanValue());
+      }
+      catch(Exception e)
+      {
+         getLog().info("Failed to access EarLibClass in unpacked-earlib-custom.ear", e);
+         throw e;
+      }
+      finally
+      {
+         undeploy("unpacked-earlib-custom.ear");
+      }
+      
+   }
 
+   /**
+    * Validate that the earlib-implicit.ear/lib jars are added to
+    * the ear classpath.
+    * 
+    * @throws Exception
+    */
+   public void testEarLibImplicit() throws Exception
+   {
+      getLog().debug("+++ testEarLibImplicit");
+      try
+      {
+         deploy("earlib-implicit.ear");
+         ObjectName name = new ObjectName("jboss.test:name=libService");
+         String[] sig = {String.class.getName()};
+         Object[] args = {"org.jboss.test.deployment.earlib.util.EarLibClass"};
+         Boolean ok = (Boolean) super.invoke(name, "loadClass", args, sig);
+         assertTrue("loadClass was ok", ok.booleanValue());
+      }
+      catch(Exception e)
+      {
+         getLog().info("Failed to access EarLibClass in earlib-implicit.ear", e);
+         throw e;
+      }
+      finally
+      {
+         undeploy("earlib-implicit.ear");
+      }
+      
+   }
+
+   /**
+    * Validate that the unpacked-earlib-implicit.ear/lib jars are added
+    * to the ear classpath.
+    * 
+    * @throws Exception
+    */
+   public void testUnpackedEarLibImplicit() throws Exception
+   {
+      getLog().debug("+++ testUnpackedEarLibImplicit");
+      try
+      {
+         deploy("unpacked-earlib-implicit.ear");
+         ObjectName name = new ObjectName("jboss.test:name=libService");
+         String[] sig = {String.class.getName()};
+         Object[] args = {"org.jboss.test.deployment.earlib.util.EarLibClass"};
+         Boolean ok = (Boolean) super.invoke(name, "loadClass", args, sig);
+         assertTrue("loadClass was ok", ok.booleanValue());
+      }
+      catch(Exception e)
+      {
+         getLog().info("Failed to access EarLibClass in unpacked-earlib-implicit.ear", e);
+         throw e;
+      }
+      finally
+      {
+         undeploy("unpacked-earlib-implicit.ear");
+      }
+      
+   }
+
+   /**
+    * Validate that the earlib-nolib.ear/lib jars are NOT added to
+    * the ear classpath.
+    * 
+    * @throws Exception
+    */
+   public void testNoEarLib() throws Exception
+   {
+      getLog().debug("+++ testNoEarLib");
+      try
+      {
+         deploy("earlib-nolib.ear");
+         ObjectName name = new ObjectName("jboss.test:name=libService");
+         String[] sig = {String.class.getName()};
+         Object[] args = {"org.jboss.test.deployment.earlib.util.EarLibClass"};
+         Boolean ok = (Boolean) super.invoke(name, "loadClass", args, sig);
+         fail("loadClass was ok, "+ok);
+      }
+      catch(ClassNotFoundException e)
+      {
+         getLog().info("Failed to access EarLibClass in earlib-nolib.ear", e);
+      }
+      finally
+      {
+         undeploy("earlib-nolib.ear");
+      }
+      
+   }
 }

Modified: branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-custom.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-custom.xml	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-custom.xml	2007-02-19 23:03:46 UTC (rev 60684)
@@ -1,8 +1,8 @@
 <?xml version='1.0' encoding='UTF-8'?>
 
 <!DOCTYPE jboss-app
-  PUBLIC  "-//JBoss//DTD J2EE Application 1.4V2//EN"
-          "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd"
+    PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd"
 >
 
 <jboss-app>

Modified: branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-implicit.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-implicit.xml	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-implicit.xml	2007-02-19 23:03:46 UTC (rev 60684)
@@ -1,8 +1,8 @@
 <?xml version='1.0' encoding='UTF-8'?>
 
 <!DOCTYPE jboss-app
-  PUBLIC  "-//JBoss//DTD J2EE Application 1.4//EN"
-          "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd"
+    PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd"
 >
 
 <jboss-app>

Modified: branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-nolib.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-nolib.xml	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-nolib.xml	2007-02-19 23:03:46 UTC (rev 60684)
@@ -1,8 +1,8 @@
 <?xml version='1.0' encoding='UTF-8'?>
 
 <!DOCTYPE jboss-app
-  PUBLIC  "-//JBoss//DTD J2EE Application 1.4//EN"
-          "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd"
+    PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd"
 >
 
 <jboss-app>

Modified: branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml	2007-02-19 23:02:04 UTC (rev 60683)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml	2007-02-19 23:03:46 UTC (rev 60684)
@@ -1,5 +1,5 @@
 <server>
 	<mbean code="org.jboss.test.deployment.earlib.services.LibService"
 		name="jboss.test:name=libService">
-	</name>
+	</mbean>
 </server>




More information about the jboss-cvs-commits mailing list