[jboss-cvs] JBossAS SVN: r60678 - in branches/Branch_4_2/testsuite: src/main/org/jboss/test/deployment and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 19 16:19:37 EST 2007


Author: scott.stark at jboss.org
Date: 2007-02-19 16:19:37 -0500 (Mon, 19 Feb 2007)
New Revision: 60678

Added:
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/
   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/LibServiceMBean.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/EarLibClass.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/LibBaseClass.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/test/EARLibUnitTestCase.java
   branches/Branch_4_2/testsuite/src/resources/deployment/earlib/
   branches/Branch_4_2/testsuite/src/resources/deployment/earlib/application.xml
   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
Modified:
   branches/Branch_4_2/testsuite/imports/sections/deployers.xml
Log:
JBAS-4037, add a library-directory support for ears

Modified: branches/Branch_4_2/testsuite/imports/sections/deployers.xml
===================================================================
--- branches/Branch_4_2/testsuite/imports/sections/deployers.xml	2007-02-19 21:17:01 UTC (rev 60677)
+++ branches/Branch_4_2/testsuite/imports/sections/deployers.xml	2007-02-19 21:19:37 UTC (rev 60678)
@@ -296,6 +296,69 @@
             <include name="deployment-web-jboss.war"/>
          </fileset>
       </ear>
-      
+
+      <!-- custom ear lib contents -->
+   	<echo message="earlib.jar" />
+   	<jar destfile="${build.lib}/earlib.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/deployment/earlib/util/*"/>
+         </fileset>
+   	</jar>
+   	<jar destfile="${build.lib}/earlib.sar">
+         <zipfileset dir="${build.resources}/deployment/earlib" prefix="META-INF">
+            <include name="jboss-service.xml"/>
+         </zipfileset>
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/deployment/earlib/services/*"/>
+         </fileset>
+   	</jar>
+
+      <!-- custom ear lib directory ear -->
+      <ear destfile="${build.lib}/earlib-custom.ear"
+         appxml="${build.resources}/deployment/earlib/application.xml"
+         update="true">
+         <zipfileset dir="${build.resources}/deployment/earlib" fullpath="META-INF/jboss-app.xml">
+            <include name="jboss-app-custom.xml"/>
+         </zipfileset>
+         <fileset dir="${build.lib}">
+            <include name="earlib.sar"/>
+         </fileset>
+         <zipfileset dir="${build.lib}" prefix="custom-lib">
+            <include name="earlib.jar"/>
+         </zipfileset>
+      </ear>
+
+      <!-- implicit ear lib directory ear -->
+      <ear destfile="${build.lib}/earlib-implicit.ear"
+         appxml="${build.resources}/deployment/earlib/application.xml"
+         update="true">
+         <zipfileset dir="${build.resources}/deployment/earlib" fullpath="META-INF/jboss-app.xml">
+            <include name="jboss-app-implicit.xml"/>
+         </zipfileset>
+         <fileset dir="${build.lib}">
+            <include name="earlib.sar"/>
+         </fileset>
+         <zipfileset dir="${build.lib}" prefix="lib">
+            <include name="earlib.jar"/>
+         </zipfileset>
+      </ear>
+
+   	<!-- no ear lib directory ear -->
+      <ear destfile="${build.lib}/earlib-nolib.ear"
+         appxml="${build.resources}/deployment/earlib/application.xml"
+         update="true">
+         <zipfileset dir="${build.resources}/deployment/earlib" fullpath="META-INF/jboss-app.xml">
+            <include name="jboss-app-nolib.xml"/>
+         </zipfileset>
+         <fileset dir="${build.lib}">
+            <include name="earlib.sar"/>
+         </fileset>
+      	<!-- Include the lib contents to validate that it is ignored
+      	-->
+         <zipfileset dir="${build.lib}" prefix="lib">
+            <include name="earlib.jar"/>
+         </zipfileset>
+      </ear>
+
    </target>
-</project>
\ No newline at end of file
+</project>

Added: 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	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibService.java	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployment.earlib.services;
+
+/**
+ * A service that tests classes found in an ear lib
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class LibService
+{
+   public boolean loadClass(String name) throws ClassNotFoundException
+   {
+      ClassLoader loader = Thread.currentThread().getContextClassLoader();
+      Class c = loader.loadClass(name);
+      return c.getName().equals(name);
+   }
+
+}

Added: branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibServiceMBean.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibServiceMBean.java	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/services/LibServiceMBean.java	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployment.earlib.services;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface LibServiceMBean
+{
+   public boolean loadClass(String name) throws ClassNotFoundException;
+}

Added: branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/EarLibClass.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/EarLibClass.java	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/EarLibClass.java	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployment.earlib.util;
+
+/**
+ * A class available from the ear lib
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class EarLibClass extends LibBaseClass
+{
+   public void noop()
+   {
+   }
+}

Added: branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/LibBaseClass.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/LibBaseClass.java	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/earlib/util/LibBaseClass.java	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployment.earlib.util;
+
+/**
+ * A base class for other classes in the ear lib
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class LibBaseClass
+{
+
+}

Added: 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	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/deployment/test/EARLibUnitTestCase.java	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployment.test;
+
+import javax.management.ObjectName;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * A test that validates the ear library-directory configuration
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 57211 $
+ */
+public class EARLibUnitTestCase extends JBossTestCase
+{
+   public EARLibUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testEarLibCustom() throws Exception
+   {
+      getLog().debug("+++ testEarLibCustom");
+      try
+      {
+         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"};
+         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-custom.ear", e);
+         throw e;
+      }
+      finally
+      {
+         undeploy("earlib-custom.ear");
+      }
+      
+   }
+
+}

Added: branches/Branch_4_2/testsuite/src/resources/deployment/earlib/application.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/deployment/earlib/application.xml	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/application.xml	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<application version="1.4"
+             xmlns="http://java.sun.com/xml/ns/j2ee" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+                                 http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
+>
+
+   <display-name>EAR Deployment Test</display-name>
+	<!-- No modules -->
+</application>

Added: 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	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-custom.xml	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,13 @@
+<?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"
+>
+
+<jboss-app>
+	<!-- Test that a custom library directory contents is added -->
+   <library-directory>custom-lib</library-directory>
+   <module><service>earlib.sar</service></module>
+
+</jboss-app>

Added: 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	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-implicit.xml	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,13 @@
+<?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"
+>
+
+<jboss-app>
+
+	<!-- Test that the implicit lib directory contents is added -->
+   <module><service>earlib.sar</service></module>
+   
+</jboss-app>

Added: 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	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-app-nolib.xml	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,14 @@
+<?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"
+>
+
+<jboss-app>
+	<!-- Test that no library directory is added -->
+   <library-directory />
+
+   <module><service>earlib.sar</service></module>
+   
+</jboss-app>

Added: branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml	                        (rev 0)
+++ branches/Branch_4_2/testsuite/src/resources/deployment/earlib/jboss-service.xml	2007-02-19 21:19:37 UTC (rev 60678)
@@ -0,0 +1,5 @@
+<server>
+	<mbean code="org.jboss.test.deployment.earlib.services.LibService"
+		name="jboss.test:name=libService">
+	</name>
+</server>




More information about the jboss-cvs-commits mailing list