[jboss-cvs] JBossAS SVN: r103773 - in trunk: component-matrix and 10 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Apr 10 18:26:54 EDT 2010


Author: thomas.diesler at jboss.com
Date: 2010-04-10 18:26:53 -0400 (Sat, 10 Apr 2010)
New Revision: 103773

Added:
   trunk/testsuite/src/main/org/jboss/test/osgi/
   trunk/testsuite/src/main/org/jboss/test/osgi/simple/
   trunk/testsuite/src/main/org/jboss/test/osgi/simple/SimpleRuntimeTestCase.java
Modified:
   trunk/build/build.xml
   trunk/component-matrix/pom.xml
   trunk/osgi/jar/pom.xml
   trunk/osgi/zip/src/assembly/assembly.xml
   trunk/server/src/etc/conf/all/bootstrap/deployers.xml
   trunk/testsuite/build.xml
   trunk/testsuite/src/main/org/jboss/test/ejb/lifecycle/test/AbstractLifeCycleTestWrapper.java
   trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java
   trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java
Log:
[JBAS-7657] Basic smoke testing of OSGI functionality

Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/build/build.xml	2010-04-10 22:26:53 UTC (rev 103773)
@@ -427,10 +427,6 @@
       </fileset>
     </copy>
   	
-  	<!-- [JBAS-7909] AOPClassLoaderDeployer breaks OSGi integration -->
-  	<move file="${install.osgi.deployers}/osgi.deployer/jboss-as-osgi-integration.jar" todir="${install.lib}"/>
-  	<move file="${install.osgi.deployers}/osgi.deployer/jboss-osgi-framework-metadata.jar" todir="${install.lib}"/>
-
     <!-- Build standard config manually -->
     <copy todir="${install.standard}">
       <fileset dir="${install.default}">
@@ -1756,6 +1752,14 @@
     <property name="osgi.module.name" value="osgi"/>
     <property name="osgi.module.output" value="${project.root}/${osgi.module.name}/zip/target"/>
     
+  	<!-- [JBAS-7909] AOPClassLoaderDeployer breaks OSGi integration -->
+    <echo message="${project.root}/${osgi.module.name}/jar/target"/>
+    <copy todir="${install.lib}">
+      <fileset dir="${project.root}/${osgi.module.name}/jar/target">
+        <include name="jboss-osgi-asintegration.jar"/>
+      </fileset>
+    </copy>
+
     <unzip dest="${install.osgi}" src="${osgi.module.output}/jboss-as-osgi-distribution-${pom.project.version}.zip"/>
   </target>
 
@@ -2152,6 +2156,7 @@
       <fileset refid="xerces:xercesImpl:jar"/>
       <fileset refid="apache-xerces:resolver:jar"/>
       <fileset refid="org.jboss:jbossxb:jar"/>
+      <fileset refid="org.jboss.osgi.framework:jboss-osgi-framework-metadata:jar"/>
       <mapper refid="remove-versions" />
     </copy>
 

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/component-matrix/pom.xml	2010-04-10 22:26:53 UTC (rev 103773)
@@ -21,7 +21,7 @@
   <artifactId>jboss-as-component-matrix</artifactId>
   <packaging>pom</packaging>
   <version>6.0.0-SNAPSHOT</version>
-  <name>JBossAS Component Matrix</name>
+  <name>JBoss Application Server Component Matrix</name>
   <description>
     Contract for Consumers of JBossAS Components, defining and
     centralizing the dependency management contract
@@ -72,11 +72,10 @@
     <version.jboss.osgi.webapp>0.7.2.SP2</version.jboss.osgi.webapp>
     <version.jboss.osgi.webconsole>1.0.3</version.jboss.osgi.webconsole>
     <version.jboss.osgi.xml.binding>2.0.2.Beta4.SP1</version.jboss.osgi.xml.binding>
-    <version.ops4j.pax.web>0.7.2</version.ops4j.pax.web>
     <version.jboss.web>3.0.0-beta-4</version.jboss.web>
     <version.jgroups>2.10.0.Alpha3</version.jgroups>
     <version.jsr181.api>1.0-MR1</version.jsr181.api>
-    <version.junit>3.8.2</version.junit>
+    <version.junit>4.6</version.junit>
     <version.ops4j.pax.web>0.7.2</version.ops4j.pax.web>
     <version.org.hibernate>3.5.0-CR-1</version.org.hibernate>
     <version.org.hibernate.commons.annotations>3.2.0.Beta1</version.org.hibernate.commons.annotations>
@@ -2932,6 +2931,16 @@
         <artifactId>jboss-osgi-framework-metadata</artifactId>
         <version>${version.jboss.osgi.framework}</version>
       </dependency>
+      <dependency>
+        <groupId>org.jboss.osgi.vfs</groupId>
+        <artifactId>jboss-osgi-vfs</artifactId>
+        <version>${version.jboss.osgi.vfs}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.osgi.vfs</groupId>
+        <artifactId>jboss-osgi-vfs30</artifactId>
+        <version>${version.jboss.osgi.vfs}</version>
+      </dependency>
       
       <dependency>
 	    <groupId>org.osgi</groupId>

Modified: trunk/osgi/jar/pom.xml
===================================================================
--- trunk/osgi/jar/pom.xml	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/osgi/jar/pom.xml	2010-04-10 22:26:53 UTC (rev 103773)
@@ -49,6 +49,7 @@
 
   <!-- Build -->
   <build>
+    <finalName>jboss-osgi-asintegration</finalName>
     <plugins>
     </plugins>
   </build>

Modified: trunk/osgi/zip/src/assembly/assembly.xml
===================================================================
--- trunk/osgi/zip/src/assembly/assembly.xml	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/osgi/zip/src/assembly/assembly.xml	2010-04-10 22:26:53 UTC (rev 103773)
@@ -28,7 +28,6 @@
     <dependencySet>
       <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
       <includes>
-        <include>*:jboss-as-osgi-integration:jar</include>
         <include>*:jboss-osgi-deployers-vfs30:jar</include>
         <include>*:jboss-osgi-deployment:jar</include>
         <include>*:jboss-osgi-framework:jar</include>

Modified: trunk/server/src/etc/conf/all/bootstrap/deployers.xml
===================================================================
--- trunk/server/src/etc/conf/all/bootstrap/deployers.xml	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/server/src/etc/conf/all/bootstrap/deployers.xml	2010-04-10 22:26:53 UTC (rev 103773)
@@ -25,7 +25,7 @@
       <root>${jboss.lib.url}wstx-lgpl.jar</root>
       
       <!-- [JBAS-7909] AOPClassLoaderDeployer breaks OSGi integration -->
-      <root>${jboss.lib.url}jboss-as-osgi-integration.jar</root>
+      <root>${jboss.lib.url}jboss-osgi-asintegration.jar</root>
       <root>${jboss.lib.url}jboss-osgi-framework-metadata.jar</root>
    </classloader>
 

Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/testsuite/build.xml	2010-04-10 22:26:53 UTC (rev 103773)
@@ -403,7 +403,7 @@
       <fileset refid="org.jboss.mx:jboss-jmx-annotations:jar"/>
       <fileset refid="org.jboss.mx:jboss-mbeans:jar"/>
       <fileset refid="org.jboss.mx:jboss-mbeanserver:jar"/>
-     <fileset refid="org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar"/>
+      <fileset refid="org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar"/>
       <fileset refid="org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar"/>
       <fileset refid="org.jboss.spec.javax.el:jboss-el-api_2.2_spec:jar"/>
       <fileset refid="org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:jar"/>
@@ -472,7 +472,12 @@
       <pathelement path="${project.tools}/ant/lib/ant-junit.jar"/>
       <fileset refid="org.jboss.jbossas:jboss-as-ejb3:jar"/>
       <fileset refid="org.jboss.jbossas:jboss-as-ejb3:jar:client"/>
+      <fileset refid="org.jboss.osgi:jboss-osgi-spi:jar"/>
+      <fileset refid="org.jboss.osgi.vfs:jboss-osgi-vfs:jar"/>
+      <fileset refid="org.jboss.shrinkwrap:shrinkwrap-api:jar"/>
       <fileset refid="org.jboss.test:jboss-test:jar"/>
+      <fileset refid="org.osgi:org.osgi.compendium:jar"/>
+      <fileset refid="org.osgi:org.osgi.core:jar"/>
       <path refid="org.jboss.jbossas.tomcat.classpath"/>
       <path refid="thirdparty.classpath"/>
     </path>
@@ -484,14 +489,23 @@
         <exclude name="jaxws-rt.jar"/>
         <exclude name="jaxws-tools.jar"/>
       </fileset>
-
       <pathelement path="${classpath}"/>
       <pathelement path="${local.classpath}"/>
       <pathelement path="${project.tools}/ant/lib/ant.jar"/>
       <pathelement path="${project.tools}/ant/lib/ant-junit.jar"/>
+      <fileset refid="org.apache.aries.jmx:org.apache.aries.jmx.api:jar"/>
       <fileset refid="org.jboss.jbossas:jboss-as-ejb3:jar"/>
       <fileset refid="org.jboss.jbossas:jboss-as-ejb3:jar:client"/>
+      <fileset refid="org.jboss.osgi:jboss-osgi-spi:jar"/>
+      <fileset refid="org.jboss.osgi.jmx:jboss-osgi-jmx-api:jar"/>
+      <fileset refid="org.jboss.osgi.vfs:jboss-osgi-vfs:jar"/>
+      <fileset refid="org.jboss.osgi.vfs:jboss-osgi-vfs30:jar"/>
+      <fileset refid="org.jboss.shrinkwrap:shrinkwrap-api:jar"/>
+      <fileset refid="org.jboss.shrinkwrap:shrinkwrap-spi:jar"/>
+      <fileset refid="org.jboss.shrinkwrap:shrinkwrap-impl-base:jar"/>
       <fileset refid="org.jboss.test:jboss-test:jar"/>
+      <fileset refid="org.osgi:org.osgi.compendium:jar"/>
+      <fileset refid="org.osgi:org.osgi.core:jar"/>
       <path refid="thirdparty.classpath"/>
     </path>
 
@@ -696,7 +710,7 @@
        failonerror="${javac.fail.onerror}">
        <src path="${source.java.5}"/>
        <classpath refid="tests.compile.classpath"/>
-         <include name="org/jboss/test/aop/**"/>
+       <include name="org/jboss/test/aop/**"/>
      </javac>
 
       <!-- The aop tests use JDK 5 annotations, so make sure that the jboss-aop-jdk50.jar comes before the JDK1.4 style annotations defined in jboss-messaging-client.jar  -->
@@ -718,7 +732,7 @@
        failonerror="${javac.fail.onerror}">
        <src path="${source.java}"/>
        <classpath refid="annotations.classpath"/>
-         <include name="org/jboss/test/aop/**"/>
+       <include name="org/jboss/test/aop/**"/>
      </javac>
 
    </target>
@@ -918,14 +932,23 @@
    <patternset id="deployment-service.excludes">
       <exclude name="org/jboss/test/deployment/test/*TestCase.class"/>
    </patternset>
-   <!-- Tests needing IIOP setup -->
-   <patternset id="iiop.includes">
-      <include name="org/jboss/test/*iiop/test/*TestCase.class"/>
-      <exclude name="org/jboss/test/txiiop/test/*TestCase.class"/>
-   </patternset>
-   <patternset id="iiop.excludes">
-      <exclude name="org/jboss/test/*iiop/test/*"/>
-   </patternset>
+  <!-- Tests needing IIOP setup -->
+  <patternset id="iiop.includes">
+     <include name="org/jboss/test/*iiop/test/*TestCase.class"/>
+     <exclude name="org/jboss/test/txiiop/test/*TestCase.class"/>
+  </patternset>
+  <patternset id="iiop.excludes">
+     <exclude name="org/jboss/test/*iiop/test/*"/>
+  </patternset>
+  <!-- Tests needing OSGi setup -->
+  <patternset id="osgi.includes">
+    <include name="org/jboss/test/osgi/*TestCase.class"/>
+    <include name="org/jboss/test/osgi/*/*TestCase.class"/>
+  </patternset>
+  <patternset id="osgi.excludes">
+    <exclude name="org/jboss/test/osgi/*TestCase.class"/>
+    <exclude name="org/jboss/test/osgi/*/*TestCase.class"/>
+  </patternset>
    <!-- A patternset that requires jboss to run with a JACC security manager -->
    <patternset id="jacc.includes">
       <include name="**/test/jacc/test/*TestCase.class"/>
@@ -945,7 +968,6 @@
    <patternset id="jacc.allstarrole.includes">
       <include name="org/jboss/test/jacc/test/allstarrole/*TestCase.class"/>
    </patternset>
-
    <patternset id="ldap.includes">
       <include name="**/test/security/test/opends/*TestCase.class"/>
    </patternset>
@@ -2619,6 +2641,45 @@
       </junit>
    </target>
 
+  <!-- Test the OSGi setup -->
+  <target name="tests-osgi" depends="init" description="">
+    <mkdir dir="${build.reports}"/>
+    <mkdir dir="${build.testlog}"/>
+    <junit dir="${module.output}"
+      printsummary="${junit.printsummary}"
+      haltonerror="${junit.haltonerror}"
+      haltonfailure="${junit.haltonfailure}"
+      fork="${junit.fork}"
+      timeout="${junit.timeout}"
+      jvm="${junit.jvm}">
+
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
+      <sysproperty key="build.testlog" value="${build.testlog}"/>
+      <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
+      <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
+      <sysproperty key="jbosstest.server.host" value="${node0}"/>
+
+      <classpath>
+        <pathelement location="${build.classes}"/>
+        <pathelement location="${build.resources}"/>
+        <path refid="tests.classpath"/>
+      </classpath>
+
+      <formatter type="xml" usefile="${junit.formatter.usefile}"/>
+      <formatter type="plain" usefile="${junit.formatter.usefile}"/>
+
+      <batchtest todir="${build.reports}"
+        haltonerror="${junit.batchtest.haltonerror}"
+        haltonfailure="${junit.batchtest.haltonfailure}"
+        fork="${junit.batchtest.fork}">
+         <fileset dir="${build.classes}">
+            <patternset refid="osgi.includes"/>
+         </fileset>
+      </batchtest>
+    </junit>
+   </target>
+	
    <!--
       | IIOP test cases that should run successfully
     -->
@@ -3009,6 +3070,7 @@
      description="AOP tests requiring a native classloader hook">
        <run-junit junit.patternset="aop-with-classloader.includes" junit.configuration="aop-scoped"/>
    </target>
+  
    <!-- Test for ws-bpel integration -->
    <target name="tests-bpel">
       <!-- define tasks used in this target -->
@@ -3035,7 +3097,6 @@
       <server:stop name="jbpm-bpel"/>
    </target>
 
-	
    <!-- ============================================= JBM Targets ============================= -->
 	
    <!--  Starts two servers, run few simultaneous tests, kill the server only once and get the results of all the tests  -->
@@ -3132,11 +3193,7 @@
       </batchtest>
     </junit>
    </target>
-  
 
-   
-
-
    <!--
      | Run JMS tests against the Messaging JMS provider
    -->

Modified: trunk/testsuite/src/main/org/jboss/test/ejb/lifecycle/test/AbstractLifeCycleTestWrapper.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ejb/lifecycle/test/AbstractLifeCycleTestWrapper.java	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/testsuite/src/main/org/jboss/test/ejb/lifecycle/test/AbstractLifeCycleTestWrapper.java	2010-04-10 22:26:53 UTC (rev 103773)
@@ -32,6 +32,7 @@
 import javax.management.ObjectName;
 
 import junit.framework.Protectable;
+import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestResult;
 import junit.framework.TestSuite;
@@ -243,19 +244,24 @@
       return getTestCases(testClass, null);
    }
    
+   @SuppressWarnings("unchecked")
    protected Enumeration<TestCase> getTestCases(Class<? extends TestCase> testClass, Collection<String> excludes)
    {
       if(testClass == null ) return Collections.enumeration(Collections.EMPTY_SET);
       
-      Enumeration<TestCase> testCases = new TestSuite(testClass).tests();
-      if(excludes == null || excludes.isEmpty()) return testCases;
+      Enumeration<Test> testCases = new TestSuite(testClass).tests();
+      if(excludes == null || excludes.isEmpty()) return Collections.enumeration(Collections.EMPTY_SET);
       
       List<TestCase> filtered = new ArrayList<TestCase>();
       while(testCases.hasMoreElements())
       {
-         TestCase t = testCases.nextElement();
-         if(! excludes.contains(t.getName()))
-            filtered.add(t);
+         Test t = testCases.nextElement();
+         if (t instanceof TestCase)
+         {
+            TestCase tc = (TestCase)t;
+            if(!excludes.contains(tc.getName()))
+               filtered.add(tc);
+         }
       }
       return Collections.enumeration(filtered);
    }

Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/perf/SendReplyPerfStressTestCase.java	2010-04-10 22:26:53 UTC (rev 103773)
@@ -74,18 +74,6 @@
       super(name);
    }
 
-   /**
-    * The main entry-point for the SendReplyPerfStressTestCase class
-    *
-    * @param args  The command line arguments
-    */
-   public static void main(String[] args)
-   {
-
-      String newArgs[] = {"org.jboss.test.jbossmessaging.perf.SendReplyPerfStressTestCase"};
-      junit.swingui.TestRunner.main(newArgs);
-   }
-
    public static class State
    {
       public int expected;

Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java	2010-04-10 13:15:16 UTC (rev 103772)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossSessionRecoverUnitTestCase.java	2010-04-10 22:26:53 UTC (rev 103773)
@@ -106,12 +106,6 @@
       session.close();
    }
 
-   static public void main ( String []args )
-   {
-      String newArgs[] = { "org.jboss.test.jbossmq.test.JBossSessionRecoverUnitTestCase" };
-      junit.swingui.TestRunner.main(newArgs);
-   }
-
    protected void connect() throws Exception
    {
       if( context == null )

Added: trunk/testsuite/src/main/org/jboss/test/osgi/simple/SimpleRuntimeTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/osgi/simple/SimpleRuntimeTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/osgi/simple/SimpleRuntimeTestCase.java	2010-04-10 22:26:53 UTC (rev 103773)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * 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.osgi.simple;
+
+//$Id$
+
+import java.io.InputStream;
+
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiManifestBuilder;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+/**
+ * A test that deployes a bundle and verifies its state
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class SimpleRuntimeTestCase extends OSGiRuntimeTest
+{
+   @Test
+   public void testSimpleBundle() throws Exception
+   {
+      // Build the bundle with shrinkwrap
+      final JavaArchive archive = Archives.create("example-simple", JavaArchive.class);
+      archive.setManifest(new Asset()
+      {
+         public InputStream openStream()
+         {
+            OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
+            builder.addBundleSymbolicName(archive.getName());
+            builder.addBundleManifestVersion(2);
+            return builder.openStream();
+         }
+      });
+
+      // Get the remote runtime
+      OSGiRuntime runtime = getRemoteRuntime();
+      try
+      {
+         // Install the bundle
+         OSGiBundle bundle = runtime.installBundle(archive);
+         assertBundleState(Bundle.INSTALLED, bundle.getState());
+
+         // Start the bundle
+         bundle.start();
+         assertBundleState(Bundle.ACTIVE, bundle.getState());
+
+         // Uninstall the bundle
+         bundle.uninstall();
+         assertBundleState(Bundle.UNINSTALLED, bundle.getState());
+      }
+      finally
+      {
+         // Shutdown the runtime 
+         runtime.shutdown();
+      }
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list