[jboss-cvs] JBossAS SVN: r108362 - in trunk/testsuite: imports/sections and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 28 06:55:49 EDT 2010


Author: alesj
Date: 2010-09-28 06:55:49 -0400 (Tue, 28 Sep 2010)
New Revision: 108362

Added:
   trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslator3rdPartyLibExampleUnitTestCase.java
Modified:
   trunk/testsuite/build.xml
   trunk/testsuite/imports/sections/weld.xml
   trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/beans.xml
   trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/beans.xml
Log:
[JBAS-8410]; add Weld 3rd party lib test -- currently manual only, hence excluded in build.xml.


Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2010-09-27 22:12:37 UTC (rev 108361)
+++ trunk/testsuite/build.xml	2010-09-28 10:55:49 UTC (rev 108362)
@@ -1158,6 +1158,8 @@
       <exclude name="org/jboss/test/web/test/StatusServletTestCase.class"/>
       <!-- JBAS-8239 -->
       <exclude name="org/jboss/test/deadlock/test/BeanStressTestCase.class"/>
+      <!-- JBAS-8410; exclude Weld libs test, currently manual only -->
+      <exclude name="org/jboss/test/deployers/weld/test/WeldTranslator3rdPartyLibExampleUnitTestCase.class"/>
    </patternset>
 
    <patternset id="aop-with-classloader.excludes">

Modified: trunk/testsuite/imports/sections/weld.xml
===================================================================
--- trunk/testsuite/imports/sections/weld.xml	2010-09-27 22:12:37 UTC (rev 108361)
+++ trunk/testsuite/imports/sections/weld.xml	2010-09-28 10:55:49 UTC (rev 108362)
@@ -7,7 +7,7 @@
          <fileset dir="${build.classes}">
             <include name="org/jboss/test/deployers/weld/translator/ejb/**"/>
          </fileset>
-	<fileset dir="${source.resources}/deployers/weld/translator/ejb">
+	      <fileset dir="${source.resources}/deployers/weld/translator/ejb">
             <include name="META-INF/beans.xml"/>
          </fileset>
       </jar>
@@ -26,15 +26,12 @@
          </fileset>
       </war>
       
-      <jar destfile="${build.lib}/weld-translator.ear">
+      <ear destfile="${build.lib}/weld-translator.ear" appxml="${source.resources}/deployers/weld/translator/META-INF/application.xml">
          <fileset dir="${build.lib}">
             <include name="weld-translator.jar"/>
             <include name="weld-translator.war"/>
          </fileset>
-	<fileset dir="${source.resources}/deployers/weld/translator">
-            <include name="META-INF/application.xml"/>
-         </fileset>
-      </jar>
+      </ear>
    </target>
 
    <!-- translator example with a plain, non-weld, ejb jar -->
@@ -47,18 +44,28 @@
          </fileset>
       </jar>
       
-      <jar destfile="${build.lib}/weld-translatorplainejb.ear">
+      <ear destfile="${build.lib}/weld-translatorplainejb.ear" appxml="${source.resources}/deployers/weld/plainEjbTranslator/META-INF/application.xml">
          <fileset dir="${build.lib}">
             <include name="weld-translator-without-beans.jar"/>
             <include name="weld-translator.war"/>
          </fileset>
-         <fileset dir="${source.resources}/deployers/weld/plainEjbTranslator">
-            <include name="META-INF/application.xml"/>
+      </ear>
+   </target>
+
+   <target name="translatorLib" depends="compile">
+
+      <jar destfile="${build.lib}/weld-translator-lib.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/deployers/weld/translator/ejb/SentenceParser.class"/>
          </fileset>
+         <fileset dir="${source.resources}/deployers/weld/translator/ejb">
+            <include name="META-INF/beans.xml"/>
+         </fileset>
       </jar>
+
    </target>
-   
-   <target name="translatorWithManifestClasspath" depends="compile">
+
+   <target name="translatorWithManifestClasspath" depends="translatorLib">
       <mkdir dir="${build.lib}" />
       
       <jar destfile="${build.lib}/weld-translator-manifestclasspath.jar">
@@ -73,28 +80,38 @@
             <attribute name="Class-Path" value="../weld-translator-lib.jar"/>
          </manifest>
       </jar>
-      
-      <jar destfile="${build.lib}/weld-translator-lib.jar">
+
+      <ear destfile="${build.lib}/weld-translatormanifestcp.ear" appxml="${source.resources}/deployers/weld/translatorWithManifestClasspath/META-INF/application.xml">
+         <fileset dir="${build.lib}">
+            <include name="weld-translator-manifestclasspath.jar"/>
+            <include name="weld-translator-lib.jar"/>
+            <include name="weld-translator.war"/>
+         </fileset>
+      </ear>
+   </target>
+   
+   <target name="translatorWith3rdPartyLib" depends="translatorLib">
+      <mkdir dir="${build.lib}" />
+
+      <jar destfile="${build.lib}/weld-translator-3rdpartylib.jar">
          <fileset dir="${build.classes}">
-            <include name="org/jboss/test/deployers/weld/translator/ejb/SentenceParser.class"/>
+            <include name="org/jboss/test/deployers/weld/translator/ejb/**"/>
+            <exclude name="org/jboss/test/deployers/weld/translator/ejb/SentenceParser.class"/>
          </fileset>
          <fileset dir="${source.resources}/deployers/weld/translator/ejb">
             <include name="META-INF/beans.xml"/>
          </fileset>
       </jar>
-      
-      <jar destfile="${build.lib}/weld-translatormanifestcp.ear">
+
+      <!-- This is still OK application.xml as we don't include lib jar -->
+      <ear destfile="${build.lib}/weld-translator3rdpartylib.ear" appxml="${source.resources}/deployers/weld/translatorWithManifestClasspath/META-INF/application.xml">
          <fileset dir="${build.lib}">
-            <include name="weld-translator-manifestclasspath.jar"/>
-            <include name="weld-translator-lib.jar"/>
+            <include name="weld-translator-3rdpartylib.jar"/>
             <include name="weld-translator.war"/>
          </fileset>
-         <fileset dir="${source.resources}/deployers/weld/translatorWithManifestClasspath">
-            <include name="META-INF/application.xml"/>
-         </fileset>
-      </jar>
+      </ear>
    </target>
-   
+
    <target name="numberguess" depends="compile">
       <mkdir dir="${build.lib}" />
       

Copied: trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslator3rdPartyLibExampleUnitTestCase.java (from rev 108357, trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslatorManifestCPExampleUnitTestCase.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslator3rdPartyLibExampleUnitTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslator3rdPartyLibExampleUnitTestCase.java	2010-09-28 10:55:49 UTC (rev 108362)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.deployers.weld.test;
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Test;
+
+/**
+ * Test 3rd party lib usage.
+ * 
+ * Currently you have to manually push the
+ * translator-manifest-lib.jar into common/lib directory.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ *
+ */
+public class WeldTranslator3rdPartyLibExampleUnitTestCase extends WeldExampleTest
+{
+   public WeldTranslator3rdPartyLibExampleUnitTestCase(String test)
+   {
+      super(test);
+      setTestExpected(true);
+   }
+
+    @Override
+    protected URL getBaseURL() throws Exception {
+        return new URL(getBaseURLString() + getWebContextName() + "/home.jsf");
+    }
+    
+    @Override
+    protected Set<String> getExpectedDeployments(String topLevelDeployment, String exampleName)
+    {
+       final Set<String> expected = new HashSet<String>();
+       expected.add(topLevelDeployment);
+       expected.add(String.format(exampleJar, "translator-3rdpartylib"));
+       expected.add(String.format(exampleWar, "translator"));
+       return expected;
+    }
+
+    public static Test suite() throws Exception
+   {
+      return deploy(WeldTranslator3rdPartyLibExampleUnitTestCase.class, false);
+   }
+}
+

Modified: trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/beans.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/beans.xml	2010-09-27 22:12:37 UTC (rev 108361)
+++ trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/beans.xml	2010-09-28 10:55:49 UTC (rev 108362)
@@ -0,0 +1,5 @@
+<beans
+   xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
\ No newline at end of file

Modified: trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/beans.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/beans.xml	2010-09-27 22:12:37 UTC (rev 108361)
+++ trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/beans.xml	2010-09-28 10:55:49 UTC (rev 108362)
@@ -0,0 +1,6 @@
+<beans
+   xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
+      
\ No newline at end of file



More information about the jboss-cvs-commits mailing list