Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
framework-1.4.1
-
None
-
None
-
None
Description
It seems that the order on uninstall matters
B, X - is ok
X, B - fails
/**
- [JBOSGI-39] Bundle undeploy does not clean up properly
- https://jira.jboss.org/jira/browse/JBOSGI-39
- Bundle B depends on bundle X.
- B ---> X
- @author thomas.diesler@jboss.com
- @since 04-Mar-2009
*/
public class OSGI39EmbeddedTestCase extends IntegrationTest
{
static OSGiBootstrapProvider bootProvider;
@Override
protected OSGiBootstrapProvider getBootstrapProvider()
public void testFirstRun() throws Exception
{ installBBeforeX(); }public void testSecondRun() throws Exception
{ installBBeforeX(); }
private void installBBeforeX() throws Exception
{
OSGiFramework framework = getBootstrapProvider().getFramework();
BundleContext sysContext = framework.getSystemBundleContext();
Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
try
{ bundleB.start(); fail("Unresolved constraint expected"); }catch (BundleException ex)
{ // expected }Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
bundleB.start();
assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
// Uninstall X before B
bundleX.uninstall();
bundleB.uninstall();
}
Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase) Time elapsed: 0.015 sec <<< FAILURE!
junit.framework.AssertionFailedError: Unresolved constraint expected
at junit.framework.Assert.fail(Assert.java:47)
at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)
2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
Attachments
Issue Links
- is related to
-
FELIX-1040 Bundle may start with unresolved packages
- Resolved