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

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Fri Nov 13 11:13:32 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-11-13 11:13:31 -0500 (Fri, 13 Nov 2009)
New Revision: 96365

Added:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-allgood.bnd
Removed:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd
Modified:
   projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
Log:
[JBOSGI-204] Failure in Bundle.start() uninstalls the bundle
More logging

Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2009-11-13 15:49:51 UTC (rev 96364)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2009-11-13 16:13:31 UTC (rev 96365)
@@ -100,7 +100,7 @@
     <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-dontfail.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-dontfail.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-allgood.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-allgood.bnd" />
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonresolve.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonresolve.bnd" />
     <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-failonstart.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-failonstart.bnd" />
   	

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java	2009-11-13 15:49:51 UTC (rev 96364)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java	2009-11-13 16:13:31 UTC (rev 96365)
@@ -35,6 +35,8 @@
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * [JBOSGI-99] No explicit control over bundle.start()
@@ -46,6 +48,9 @@
  */
 public class OSGI99TestCase
 {
+   // Provide logging
+   private static Logger log = LoggerFactory.getLogger(OSGI99TestCase.class);
+
    private static OSGiRuntime runtime;
 
    @BeforeClass
@@ -65,9 +70,9 @@
    }
 
    @Test
-   public void testDontFail() throws Exception
+   public void testAllGood() throws Exception
    {
-      OSGiBundle bundle = runtime.installBundle("jbosgi99-dontfail.jar");
+      OSGiBundle bundle = runtime.installBundle("jbosgi99-allgood.jar");
       assertBundleState(bundle, Bundle.INSTALLED);
 
       bundle.start();
@@ -90,11 +95,12 @@
          bundle.start();
          fail("BundleException expected");
       }
-      catch (BundleException e)
+      catch (BundleException ex)
       {
+         log.error("State on error: " + ConstantsHelper.bundleState(bundle.getState()), ex);
          assertBundleState(bundle, Bundle.INSTALLED);
       }
-      
+
       bundle.uninstall();
 
       if (runtime.isRemoteRuntime() == false)
@@ -112,11 +118,12 @@
          bundle.start();
          fail("BundleException expected");
       }
-      catch (BundleException e)
+      catch (BundleException ex)
       {
+         log.error("State on error: " + ConstantsHelper.bundleState(bundle.getState()), ex);
          assertBundleState(bundle, Bundle.RESOLVED);
       }
-      
+
       bundle.uninstall();
 
       if (runtime.isRemoteRuntime() == false)

Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-allgood.bnd (from rev 96362, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-allgood.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-allgood.bnd	2009-11-13 16:13:31 UTC (rev 96365)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi99-allgood.jar src/test/resources/jbosgi99/jbosgi99-allgood.bnd
+
+Bundle-SymbolicName: jbosgi99-allgood
+Export-Package: org.jboss.test.osgi.jbosgi99.bundle
+

Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd	2009-11-13 15:49:51 UTC (rev 96364)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi99/jbosgi99-dontfail.bnd	2009-11-13 16:13:31 UTC (rev 96365)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi99-bundleA.jar src/test/resources/jbosgi99/jbosgi99-bundleA.bnd
-
-Bundle-SymbolicName: jbosgi99-dontfail
-Export-Package: org.jboss.test.osgi.jbosgi99.bundle
-



More information about the jboss-osgi-commits mailing list