Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1040

Bundle may start with unresolved packages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • framework-1.4.1, framework-1.6.0
    • None
    • Framework
    • None

    Description

      After an upgrade to felix-1.6.0 I see one of my test cases failing that explicitly tests that a bundle cannot be started if an import is not satisfied.

      junit.framework.AssertionFailedError: Unresolved constraint expected
      at junit.framework.Assert.fail(Assert.java:47)
      at org.jboss.test.osgi.jbosgi39.OSGI39TestCase.testVerifyUnresolved(OSGI39TestCase.java:59)

      public void testVerifyUnresolved() throws Exception
      {
      OSGiFramework framework = getBootstrapProvider().getFramework();
      BundleContext sysContext = framework.getSystemBundleContext();

      Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-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("jbosgi39-bundleX.jar").toExternalForm());

      bundleB.start();

      assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());

      bundleB.uninstall();
      bundleX.uninstall();
      }

      Unfortunately, the test only fails rarely. I attached the test bundles.

      The sources are here

      https://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/

      Attachments

        1. jbosgi39-bundleB.jar
          2 kB
          Thomas Diesler
        2. jbosgi39-bundleX.jar
          2 kB
          Thomas Diesler

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tdiesler Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: