[jboss-cvs] JBossAS SVN: r92945 - in projects/jboss-osgi/trunk/testsuite: example and 15 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 28 07:46:01 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-08-28 07:46:00 -0400 (Fri, 28 Aug 2009)
New Revision: 92945

Added:
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd
Removed:
   projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI38TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/SomePojo.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleB.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleX.bnd
Modified:
   projects/jboss-osgi/trunk/testsuite/example/pom.xml
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
   projects/jboss-osgi/trunk/testsuite/functional/pom.xml
   projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
   projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
[JBOSGI-142] Investigate if exporter can load classes from importer

Deleted: projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,9 +0,0 @@
-#Tue Feb 17 14:09:40 CET 2009
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1

Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml	2009-08-28 11:46:00 UTC (rev 92945)
@@ -143,6 +143,84 @@
   
   <!-- Profiles -->
   <profiles>
+  
+    <!--
+      Name: framework-equinox
+      Descr: Setup for Equinox framework integration testing
+    -->
+    <profile>
+      <id>framework-equinox</id>
+      <activation>
+        <property>
+          <name>framework</name>
+          <value>equinox</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>org/jboss/test/osgi/**</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <!--
+      Name: framework-felix
+      Descr: Setup for Felix framework integration testing
+    -->
+    <profile>
+      <id>framework-felix</id>
+      <activation>
+        <property>
+          <name>framework</name>
+          <value>felix</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <!--
+      Name: framework-jbossmc
+      Descr: Setup for JBossMC framework integration testing
+    -->
+    <profile>
+      <id>framework-jbossmc</id>
+      <activation>
+        <property>
+          <name>framework</name>
+          <value>jbossmc</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
   </profiles>
 
 </project>

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,83 @@
+/*
+ * 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.example.simple;
+
+//$Id: SimpleTestCase.java 91196 2009-07-14 09:41:15Z thomas.diesler at jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.test.osgi.example.simple.bundle.SimpleService;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * A test that deployes a bundle and verifies its state
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 28-Aug-2009
+ */
+public class SimpleFrameworkLaunchTestCase extends OSGiTest
+{
+   @Test
+   public void testSimpleBundle() throws Exception
+   {
+      OSGiBootstrapProvider bootstrapProvider = OSGiBootstrap.getBootstrapProvider();
+      Framework framework = bootstrapProvider.getFramework();
+      framework.start();
+      
+      BundleContext sysContext = framework.getBundleContext();
+      
+      Bundle bundle = sysContext.installBundle(getBundleLocation("example-simple.jar"));
+      assertEquals("example-simple", bundle.getSymbolicName());
+      
+      bundle.start();
+      assertEquals("Bundle state", Bundle.ACTIVE, bundle.getState());
+      
+      BundleContext bndContext = bundle.getBundleContext();
+      assertNotNull("BundleContext not null", bndContext);
+      
+      // getServiceReference from bundle context
+      ServiceReference sref = bndContext.getServiceReference(SimpleService.class.getName());
+      assertNotNull("ServiceReference not null", sref);
+      
+      // getServiceReference from system context
+      sref = sysContext.getServiceReference(SimpleService.class.getName());
+      assertNotNull("ServiceReference not null", sref);
+      
+      bundle.uninstall();
+      assertEquals("Bundle state", Bundle.UNINSTALLED, bundle.getState());
+
+      framework.stop();
+      framework.waitForStop(5000);
+   }
+   private String getBundleLocation(String jarname)
+   {
+      return getTestArchiveURL(jarname).toExternalForm();
+   }
+}
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-08-28 11:46:00 UTC (rev 92945)
@@ -14,27 +14,23 @@
       <map keyClass="java.lang.String" valueClass="java.lang.String">
         <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
         <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+        <entry><key>org.osgi.framework.system.packages.extra</key><value>
+          org.jboss.logging;version=2.0,
+          org.jboss.osgi.spi.capability;version=1.0,
+          org.jboss.osgi.spi.logging;version=1.0,
+          org.jboss.osgi.spi.management;version=1.0,
+          org.jboss.osgi.spi.service;version=1.0,
+          org.jboss.osgi.spi.testing;version=1.0,
+          org.jboss.osgi.spi.util;version=1.0
+        </value></entry>
       </map>
     </property>
     <incallback method="addPlugin" />
     <uncallback method="removePlugin" />
   </bean>
   
-  <bean name="OSGiSystemPackages" class="org.jboss.osgi.plugins.facade.plugins.SystemPackagesPluginImpl">
+  <bean name="OSGiAutoInstallPlugin" class="org.jboss.osgi.plugins.facade.plugins.AutoInstallPluginImpl">
     <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
-    <property name="extraPackages">
-      <list elementClass="java.lang.String">
-        <value>org.jboss.logging;version=2.0</value>
-        <value>org.jboss.osgi.spi.logging;version=1.0</value>
-        <value>org.jboss.osgi.spi.management;version=1.0</value>
-        <value>org.jboss.osgi.spi.service;version=1.0</value>
-        <value>org.jboss.osgi.spi.util;version=1.0</value>
-      </list>
-    </property>
-  </bean>
-  
-  <bean name="jboss.osgi:plugin=AutoInstall" class="org.jboss.osgi.plugins.facade.plugins.AutoInstallPluginImpl">
-    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
     <property name="autoInstall">
      <list elementClass="java.net.URL">
       <!-- [JBOSGI-136] Cannot resolve dependency against unstarted bundle
@@ -49,10 +45,15 @@
      </list>
     </property>
   </bean>
-  
+  <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.plugins.facade.plugins.FrameworkEventsPluginImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
   <bean name="OSGiStoragePlugin" class="org.jboss.osgi.plugins.facade.plugins.BundleStoragePluginImpl">
     <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
   </bean>
+  <bean name="OSGiSystemPackages" class="org.jboss.osgi.plugins.facade.plugins.SystemPackagesPluginImpl">
+    <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+  </bean>
   
   <!--
   ********************************

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,3 +1,3 @@
-org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider  # The MC Facade bootstrap provider
+org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider  # The MC Framework bootstrap provider
 org.jboss.osgi.equinox.EquinoxBootstrapProvider                      # The Equinox bootstrap provider  
 org.jboss.osgi.felix.FelixBootstrapProvider                          # The Felix bootstrap provider
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties	2009-08-28 11:46:00 UTC (rev 92945)
@@ -21,6 +21,7 @@
     org.jboss.osgi.common.log;version=1.0, \
   	org.jboss.osgi.spi;version=1.0, \
   	org.jboss.osgi.spi.capability;version=1.0, \
+  	org.jboss.osgi.spi.framework;version=1.0, \
   	org.jboss.osgi.spi.logging;version=1.0, \
   	org.jboss.osgi.spi.management;version=1.0, \
   	org.jboss.osgi.spi.service;version=1.0, \

Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-08-28 11:46:00 UTC (rev 92945)
@@ -109,6 +109,81 @@
     </profile>
 
     <!--
+      Name: framework-equinox
+      Descr: Setup for Equinox framework integration testing
+    -->
+    <profile>
+      <id>framework-equinox</id>
+      <activation>
+        <property>
+          <name>framework</name>
+          <value>equinox</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>${target.container.excludes}</exclude>
+                <exclude>org/jboss/test/osgi/**</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <!--
+      Name: framework-felix
+      Descr: Setup for Felix framework integration testing
+    -->
+    <profile>
+      <id>framework-felix</id>
+      <activation>
+        <property>
+          <name>framework</name>
+          <value>felix</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>${target.container.excludes}</exclude>
+                <exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>framework-default</id>
+      <activation>
+        <property>
+          <name>!framework</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>${target.container.excludes}</exclude>
+                <exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    
+    <!--
       Name: framework-jbossmc
       Descr: Setup for JBossMC framework integration testing
     -->
@@ -126,13 +201,8 @@
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <excludes>
-                <exclude>org/jboss/test/osgi/jbossas/**</exclude>
-                <exclude>org/jboss/test/osgi/jbosgi38/**</exclude>
-                <exclude>org/jboss/test/osgi/jbosgi39/**</exclude>
-                <exclude>org/jboss/test/osgi/jbosgi41/**</exclude>
-                <exclude>org/jboss/test/osgi/jbosgi108/**</exclude>
-                <exclude>org/jboss/test/osgi/jbosgi112/**</exclude>
-                <exclude>org/jboss/test/osgi/service/startlevel/**</exclude>
+                <exclude>${target.container.excludes}</exclude>
+                <exclude>org/jboss/test/osgi/**</exclude>
               </excludes>
             </configuration>
           </plugin>

Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2009-08-28 11:46:00 UTC (rev 92945)
@@ -8,6 +8,21 @@
 
 <!-- $Id: antrun-test-jars.xml 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $ -->
 
+<!--
+
+ [JBOSGI-36]  Bundle classes leak into system classloader
+ [JBOSGI-37]  Prevent creation of deployment unit for nested jars 
+ [JBOSGI-38]  Investigate bundle install/start behaviour with random deployment order
+ [JBOSGI-39]  Bundle gets wired to an already uninstalled bundle
+ [JBOSGI-41]  Verify persistent file storage
+ [JBOSGI-92]  Class.forName issue with XMLParserActivator
+ [JBOSGI-99]  No explicit control over bundle.start()
+ [JBOSGI-108] Investigate statics on PackageAdmin.refresh
+ [JBOSGI-112] Investigate Exception in SynchronousBundleListener
+ [JBOSGI-142] Investigate classloading space
+
+-->
+
 <project default="build-test-jars">
 
   <description>OSGi test archive builder</description>
@@ -78,12 +93,12 @@
     <!-- jbosgi41 -->
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
   	
+    <!-- jbosgi92 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
+  	
     <!-- jbosgi99 -->
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-bundleA.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-bundleA.bnd" />
   	
-    <!-- jbosgi92 -->
-    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
-  	
     <!-- jbosgi108 -->
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleA.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleA.bnd" />
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleB.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleB.bnd" />
@@ -91,6 +106,11 @@
     <!-- jbosgi112 -->
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleA.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleA.bnd" />
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleB.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleB.bnd" />
+  	
+    <!-- jbosgi142 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleA.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleB.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleX.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleX.bnd" />
     
     <!-- startlevel -->
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/startlevel.jar" files="${tests.resources.dir}/service/startlevel/startlevel.bnd" />

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142 (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38)

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,120 @@
+/*
+ * 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.jbosgi142;
+
+//$Id: OSGI142TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.jbosgi142.bundleA.BeanA;
+import org.jboss.test.osgi.jbosgi142.bundleB.BeanB;
+import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * [JBOSGI-142] Investigate classloading space
+ * 
+ * https://jira.jboss.org/jira/browse/JBOSGI-142
+ * 
+ * A imports X
+ * B imports X
+ * 
+ * Can X load a class from A or B?
+ * Can A load a class from B and vice versa?
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 28-Aug-2009
+ */
+public class OSGI142TestCase extends OSGiTest
+{
+   @Test
+   public void testLoadClass() throws Exception
+   {
+      OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+      Framework framework = bootProvider.getFramework();
+      framework.start();
+      
+      BundleContext sysContext = framework.getBundleContext();
+      Bundle bundleX = sysContext.installBundle(getBundleLocation("jbosgi142-bundleX.jar"));
+      bundleX.start();
+      
+      assertBundleLoadClass(bundleX, BeanX.class, true);
+      
+      Bundle bundleA = sysContext.installBundle(getBundleLocation("jbosgi142-bundleA.jar"));
+      bundleA.start();
+      
+      assertBundleLoadClass(bundleA, BeanA.class, true);
+      
+      Bundle bundleB = sysContext.installBundle(getBundleLocation("jbosgi142-bundleB.jar"));
+      bundleB.start();
+      
+      assertBundleLoadClass(bundleB, BeanB.class, true);
+      
+      assertBundleLoadClass(bundleA, BeanX.class, true);
+      assertBundleLoadClass(bundleB, BeanX.class, true);
+ 
+      assertBundleLoadClass(bundleX, BeanA.class, false);
+      assertBundleLoadClass(bundleX, BeanB.class, false);
+      
+      assertBundleLoadClass(bundleA, BeanB.class, false);
+      assertBundleLoadClass(bundleB, BeanA.class, false);
+      
+      framework.stop();
+      framework.waitForStop(1000);
+   }
+
+   private void assertBundleLoadClass(Bundle bundle, Class<?> expClazz, boolean success) 
+   {
+      String message = bundle.getSymbolicName() + " loads " + expClazz.getName();
+      
+      Class<?> wasClass;
+      try
+      {
+         wasClass = bundle.loadClass(expClazz.getName());
+         if (success)
+         {
+            assertEquals(message, expClazz.getName(), wasClass.getName());
+         }
+         else
+            fail("ClassNotFoundException expected for: " + message);
+
+      }
+      catch (ClassNotFoundException ex)
+      {
+         if (success)
+            fail("Unexpected ClassNotFoundException for: " + message);
+      }
+   }
+
+   private String getBundleLocation(String jarname)
+   {
+      return new OSGiTestHelper().getTestArchiveURL(jarname).toExternalForm();
+   }
+}
\ No newline at end of file

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI38TestCase.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,212 +0,0 @@
-/*
- * 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.jbosgi38;
-
-//$Id: OSGI38TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
- * 
- * https://jira.jboss.org/jira/browse/JBOSGI-38
- * 
- * Bundle A depends on bundle B, both share bundle X.
- * 
- * A ---> B 
- * A ---> X <--- B
- * 
- * @author thomas.diesler at jboss.com
- * @since 02-Mar-2009
- */
-public class OSGI38TestCase extends OSGiTest
-{
-   /*
-    * Install/Start the common bundle
-    */
-   @Test
-   public void testInstallStartX() throws Exception
-   {
-      OSGiRuntime runtime = getEmbeddedRuntime();
-      try
-      {
-         OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
-         bundleX.start();
-         assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
-         
-         bundleX.uninstall();
-      }
-      finally
-      {
-         runtime.shutdown();
-      }
-   }
-
-   /*
-    * Install X, B
-    */
-   @Test
-   public void testInstallXBeforeB() throws Exception
-   {
-      OSGiRuntime runtime = getEmbeddedRuntime();
-      try
-      {
-         OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
-         OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
-         bundleB.start();
-         assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-         
-         bundleB.uninstall();
-         bundleX.uninstall();
-      }
-      finally
-      {
-         runtime.shutdown();
-      }
-   }
-
-   /*
-    * Install X, B, A
-    */
-   @Test
-   public void testInstallBBeforeA() throws Exception
-   {
-      OSGiRuntime runtime = getEmbeddedRuntime();
-      try
-      {
-         OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
-         OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
-         OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
-
-         bundleA.start();
-         assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-         
-         bundleA.uninstall();
-         bundleB.uninstall();
-         bundleX.uninstall();
-      }
-      finally
-      {
-         runtime.shutdown();
-      }
-   }
-
-   /*
-    * Install B, X
-    */
-   @Test
-   public void testInstallBBeforeX() throws Exception
-   {
-      OSGiRuntime runtime = getEmbeddedRuntime();
-      try
-      {
-         OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
-         try
-         {
-            bundleB.start();
-            fail("Unresolved constraint expected");
-         }
-         catch (BundleException ex)
-         {
-            // expected
-         }
-
-         OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
-         bundleB.start();
-         assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
-         bundleB.uninstall();
-         bundleX.uninstall();
-      }
-      finally
-      {
-         runtime.shutdown();
-      }
-   }
-
-   /*
-    * Install A, B, X
-    */
-   @Test
-   public void testInstallABeforeB() throws Exception
-   {
-      OSGiRuntime runtime = getEmbeddedRuntime();
-      try
-      {
-         OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
-
-         OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
-         try
-         {
-            bundleB.start();
-            fail("Unresolved constraint expected");
-         }
-         catch (BundleException ex)
-         {
-            // expected
-         }
-
-         OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
-         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
-         bundleB.start();
-         assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-         
-         bundleA.start();
-         assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-
-         bundleA.uninstall();
-         bundleB.uninstall();
-         bundleX.uninstall();
-      }
-      finally
-      {
-         runtime.shutdown();
-      }
-   }
-}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,34 @@
+/*
+ * 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.jbosgi142.bundleA;
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler at jboss.com $
+
+import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
+
+public class BeanA
+{
+   public BeanA(BeanX bean)
+   {
+   }
+   
+}

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceA.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,54 +0,0 @@
-/*
- * 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.jbosgi38.bundleA;
-
-//$Id: ServiceA.java 85293 2009-03-05 13:45:47Z thomas.diesler at jboss.com $
-
-import org.jboss.test.osgi.jbosgi38.bundleB.ServiceB;
-import org.jboss.test.osgi.jbosgi38.bundleX.SomePojo;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
- * 
- * @author thomas.diesler at jboss.com
- * @since 02-Mar-2009
- */
-public class ServiceA
-{
-   ServiceA(BundleContext context)
-   {
-      ServiceTracker tracker = new ServiceTracker(context, ServiceB.class.getName(), null)
-      {
-         @Override
-         public Object addingService(ServiceReference sref)
-         {
-            ServiceB serviceB = (ServiceB)super.addingService(sref);
-            serviceB.doStuffInB(new SomePojo("hello"));
-            return serviceB;
-         }
-      };
-      tracker.open();
-   }
-}

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceActivator.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,40 +0,0 @@
-/*
- * 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.jbosgi38.bundleA;
-
-//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler at jboss.com $
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class ServiceActivator implements BundleActivator
-{
-   public void start(BundleContext context)
-   {
-      ServiceA service = new ServiceA(context);
-      context.registerService(ServiceA.class.getName(), service, null);
-   }
-
-   public void stop(BundleContext context)
-   {
-   }
-}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,34 @@
+/*
+ * 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.jbosgi142.bundleB;
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler at jboss.com $
+
+import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
+
+public class BeanB
+{
+   public BeanB(BeanX bean)
+   {
+   }
+   
+}

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceActivator.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,40 +0,0 @@
-/*
- * 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.jbosgi38.bundleB;
-
-//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler at jboss.com $
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class ServiceActivator implements BundleActivator
-{
-   public void start(BundleContext context)
-   {
-      ServiceB service = new ServiceB();
-      context.registerService(ServiceB.class.getName(), service, null);
-   }
-
-   public void stop(BundleContext context)
-   {
-   }
-}
\ No newline at end of file

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceB.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,40 +0,0 @@
-/*
- * 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.jbosgi38.bundleB;
-
-//$Id: ServiceB.java 85016 2009-03-02 12:12:31Z thomas.diesler at jboss.com $
-
-import org.jboss.test.osgi.jbosgi38.bundleX.SomePojo;
-
-/**
- * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
- * 
- * @author thomas.diesler at jboss.com
- * @since 02-Mar-2009
- */
-public class ServiceB 
-{
-  public String doStuffInB(SomePojo obj)
-  {
-     return obj.toString();
-  }
-}

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,28 @@
+/*
+ * 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.jbosgi142.bundleX;
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler at jboss.com $
+
+public class BeanX
+{
+}

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/SomePojo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/SomePojo.java	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,41 +0,0 @@
-/*
- * 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.jbosgi38.bundleX;
-
-
-//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler at jboss.com $
-
-public class SomePojo
-{
-   private String message;
-   
-   public SomePojo(String message)
-   {
-      this.message = message;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "[" + message + "]";
-   }
-}

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,4 +1,3 @@
-org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider  # The MC Facade bootstrap provider
-org.jboss.osgi.jbossmc.framework.launch.FrameworkBootstrapProvider   # The legacy MC based framework bootstrap provider
+org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider  # The MC Framework bootstrap provider
 org.jboss.osgi.equinox.EquinoxBootstrapProvider                      # The Equinox bootstrap provider  
 org.jboss.osgi.felix.FelixBootstrapProvider                          # The Felix bootstrap provider
\ No newline at end of file

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142 (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38)

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi142-bundleA.jar src/test/resources/jbosgi142/bundleA.bnd
+
+Bundle-SymbolicName: jbosgi142-bundleA
+Export-Package: org.jboss.test.osgi.jbosgi142.bundleA
+

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi142-bundleB.jar src/test/resources/jbosgi142/bundleB.bnd
+
+Bundle-SymbolicName: jbosgi142-bundleB
+Export-Package: org.jboss.test.osgi.jbosgi142.bundleB
+

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd	2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi142-bundleX.jar src/test/resources/jbosgi142/bundleX.bnd
+
+Bundle-SymbolicName: jbosgi142-bundleX
+Export-Package: org.jboss.test.osgi.jbosgi142.bundleX
+

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleA.bnd	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleA.jar src/test/resources/jbosgi38/bundleA.bnd
-
-Bundle-SymbolicName: jbosgi38-bundleA
-Bundle-Activator: org.jboss.test.osgi.jbosgi38.bundleA.ServiceActivator
-Export-Package: org.jboss.test.osgi.jbosgi38.bundleA
-

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleB.bnd	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleB.jar src/test/resources/jbosgi38/bundleB.bnd
-
-Bundle-SymbolicName: jbosgi38-bundleB
-Bundle-Activator: org.jboss.test.osgi.jbosgi38.bundleB.ServiceActivator
-Export-Package: org.jboss.test.osgi.jbosgi38.bundleB
-

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleX.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd	2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleX.bnd	2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleX.jar src/test/resources/jbosgi38/bundleX.bnd
-
-Bundle-SymbolicName: jbosgi38-bundleX
-Export-Package: org.jboss.test.osgi.jbosgi38.bundleX
-

Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml	2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml	2009-08-28 11:46:00 UTC (rev 92945)
@@ -202,67 +202,54 @@
     </profile>
 
     <!--
-      Name: framework-felix 
-      Descr: Setup for Felix framework integration testing
+      Name: framework-equinox
+      Descr: Setup for Equinox framework integration testing
     -->
     <profile>
-      <id>framework-felix</id>
+      <id>framework-equinox</id>
       <activation>
         <property>
           <name>framework</name>
-          <value>felix</value>
+          <value>equinox</value>
         </property>
       </activation>
       <dependencies>
         <dependency>
           <groupId>org.jboss.osgi.runtime</groupId>
-          <artifactId>jboss-osgi-runtime-felix</artifactId>
-          <version>${version.jboss.osgi.runtime.felix}</version>
+          <artifactId>jboss-osgi-runtime-equinox</artifactId>
+          <version>${version.jboss.osgi.runtime.equinox}</version>
           <scope>provided</scope>
         </dependency>
+        <!-- equinox-3.5 does not contain package org.osgi.util.xml -->
+        <dependency>
+          <groupId>org.osgi</groupId>
+          <artifactId>org.osgi.compendium</artifactId>
+          <version>${version.osgi}</version>
+          <scope>provided</scope>
+        </dependency>
       </dependencies>
     </profile>
 
     <!--
-      Name: framework-equinox
-      Descr: Setup for Equinox framework integration testing
+      Name: framework-felix 
+      Descr: Setup for Felix framework integration testing
     -->
     <profile>
-      <id>framework-equinox</id>
+      <id>framework-felix</id>
       <activation>
         <property>
           <name>framework</name>
-          <value>equinox</value>
+          <value>felix</value>
         </property>
       </activation>
       <dependencies>
         <dependency>
           <groupId>org.jboss.osgi.runtime</groupId>
-          <artifactId>jboss-osgi-runtime-equinox</artifactId>
-          <version>${version.jboss.osgi.runtime.equinox}</version>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version.jboss.osgi.runtime.felix}</version>
           <scope>provided</scope>
         </dependency>
-        <!-- equinox-3.5 does not contain package org.osgi.util.xml -->
-        <dependency>
-          <groupId>org.osgi</groupId>
-          <artifactId>org.osgi.compendium</artifactId>
-          <version>${version.osgi}</version>
-          <scope>provided</scope>
-        </dependency>
       </dependencies>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <includes>
-                <!-- Minimal bootstrap testing -->
-                <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
-              </includes>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
     </profile>
 
     <!--
@@ -298,19 +285,9 @@
           <name>!target.container</name>
         </property>
       </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <excludes>
-                <!-- Exclude tests that require remote access -->
-                <exclude>org/jboss/test/osgi/jbossas/**</exclude>
-              </excludes>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
+      <properties>
+        <target.container.excludes>org/jboss/test/osgi/jbossas/**</target.container.excludes>
+      </properties>
     </profile>
 
     <!--
@@ -325,19 +302,9 @@
           <value>runtime</value>
         </property>
       </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <excludes>
-                <!-- Exclude tests that require jboss access -->
-                <exclude>org/jboss/test/osgi/jbossas/**</exclude>
-              </excludes>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
+      <properties>
+        <target.container.excludes>org/jboss/test/osgi/jbossas/**</target.container.excludes>
+      </properties>
     </profile>
 
     <!--
@@ -352,6 +319,9 @@
           <value>jboss501</value>
         </property>
       </activation>
+      <properties>
+        <target.container.excludes>org/jboss/test/osgi/nothing-to-exclude</target.container.excludes>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.jbossas</groupId>
@@ -375,6 +345,9 @@
           <value>jboss510</value>
         </property>
       </activation>
+      <properties>
+        <target.container.excludes>org/jboss/test/osgi/nothing-to-exclude</target.container.excludes>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.jbossas</groupId>
@@ -398,6 +371,9 @@
           <value>jboss600</value>
         </property>
       </activation>
+      <properties>
+        <target.container.excludes>org/jboss/test/osgi/nothing-to-exclude</target.container.excludes>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.jbossas</groupId>




More information about the jboss-cvs-commits mailing list