[jboss-osgi-commits] JBoss-OSGI SVN: r96980 - in projects/jboss-osgi/trunk/testsuite/functional: src/test/java/org/jboss/test/osgi/jbosgi142 and 1 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Wed Nov 25 12:37:19 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-11-25 12:37:18 -0500 (Wed, 25 Nov 2009)
New Revision: 96980

Modified:
   projects/jboss-osgi/trunk/testsuite/functional/pom.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
Log:
Fix all functional tests in embedded felix

Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-11-25 17:30:23 UTC (rev 96979)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-11-25 17:37:18 UTC (rev 96980)
@@ -196,9 +196,6 @@
             <configuration>
               <excludes>
                 <exclude>${target.container.excludes}</exclude>
-                <!-- TODO investigate felix test failures -->
-                <exclude>org/jboss/test/osgi/jbosgi37/**</exclude>
-                <exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
               </excludes>
             </configuration>
           </plugin>

Modified: 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/OSGI142TestCase.java	2009-11-25 17:30:23 UTC (rev 96979)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java	2009-11-25 17:37:18 UTC (rev 96980)
@@ -28,7 +28,7 @@
 
 import org.jboss.osgi.spi.framework.OSGiBootstrap;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiTest;
 import org.jboss.test.osgi.jbosgi142.bundleA.BeanA;
 import org.jboss.test.osgi.jbosgi142.bundleB.BeanB;
 import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
@@ -51,42 +51,47 @@
  * @author thomas.diesler at jboss.com
  * @since 28-Aug-2009
  */
-public class OSGI142TestCase
+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);
+      try
+      {
+         framework.start();
+         
+         BundleContext sysContext = framework.getBundleContext();
+         Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi142-bundleX.jar").toExternalForm());
+         bundleX.start();
+         
+         assertBundleLoadClass(bundleX, BeanX.class, true);
+         
+         Bundle bundleA = sysContext.installBundle(getTestArchiveURL("jbosgi142-bundleA.jar").toExternalForm());
+         bundleA.start();
+         
+         assertBundleLoadClass(bundleA, BeanA.class, true);
+         
+         Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi142-bundleB.jar").toExternalForm());
+         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);
+      }
+      finally
+      {
+         framework.stop();
+         framework.waitForStop(1000);
+      }
    }
 
    private void assertBundleLoadClass(Bundle bundle, Class<?> expClazz, boolean success) 
@@ -112,9 +117,4 @@
             fail("Unexpected ClassNotFoundException for: " + message);
       }
    }
-
-   private String getBundleLocation(String jarname)
-   {
-      return new OSGiTestHelper().getTestArchiveURL(jarname).toExternalForm();
-   }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties	2009-11-25 17:30:23 UTC (rev 96979)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties	2009-11-25 17:37:18 UTC (rev 96980)
@@ -4,8 +4,8 @@
 # $Id$
 #
 
-# The OSGiFramework implementation 
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+# Felix config properties  
+felix.bootdelegation.implicit=false
 
 # Properties to configure the Framework
 org.osgi.framework.storage=${basedir}/target/osgi-store



More information about the jboss-osgi-commits mailing list