[jboss-cvs] JBossAS SVN: r91223 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 14 11:15:21 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-07-14 11:15:20 -0400 (Tue, 14 Jul 2009)
New Revision: 91223

Modified:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java
Log:
[JBOSGI-112] Enable test, expect active

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java	2009-07-14 15:11:26 UTC (rev 91222)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java	2009-07-14 15:15:20 UTC (rev 91223)
@@ -23,16 +23,15 @@
 
 //$Id: OSGI39TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
 
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertEquals;
 
 import org.jboss.osgi.spi.testing.OSGiBundle;
 import org.jboss.osgi.spi.testing.OSGiRuntime;
 import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.osgi.spi.util.OSGiConstantsHelper;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.SynchronousBundleListener;
 
@@ -62,26 +61,23 @@
    }
 
    /**
-    * BundleA registers a {@link SynchronousBundleListener} which throws an exception.
-    * Start of BundleB is expected to fail. 
+    * BundleA registers a {@link SynchronousBundleListener} which throws an exception. 
+    * Start of BundleB is started and expected to be ACTIVE.
     */
    @Test
-   @Ignore
    public void testInstallBundles() throws Exception
    {
       OSGiBundle bundleA = runtime.installBundle("jbosgi112-bundleA.jar");
       bundleA.start();
 
       OSGiBundle bundleB = runtime.installBundle("jbosgi112-bundleB.jar");
-      try
-      {
-         bundleB.start();
-         String bundleState = OSGiConstantsHelper.bundleState(bundleB.getState());
-         fail("BundleException expected, but bundle state is: " + bundleState);
-      }
-      catch (BundleException ex)
-      {
-         // expected
-      }
+      bundleB.start();
+      
+      // Exceptions thrown from listeners are logged but otherwise ignored. 
+      // Throwing an exception from a listener will not prevent the bundle from proceeding with starting.
+      // If the BP extender detects some issue with the BP configuration, it can/should log this information 
+      // but it cannot prevent the bundle from starting.
+      
+      assertEquals("ACTIVE expected", Bundle.ACTIVE, bundleB.getState());
    }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list