[ 
https://issues.apache.org/jira/browse/FELIX-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700047#action_12700047
 ] 

Thomas Diesler commented on FELIX-1040:
---------------------------------------

I can reliably reproduce this issue 

[tdies...@tdvaio functional]$ mvn -Dtest=FELIX1040TestCase test

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jboss.test.osgi.jbosgi39.FELIX1040TestCase
org.apache.felix.framework
org.apache.felix.log
org.jboss.osgi.common
org.jboss.osgi.service.logging
>>>
org.apache.felix.framework
org.apache.felix.log
org.jboss.osgi.common
org.jboss.osgi.service.logging
jbosgi37-bundleA
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.539 sec <<< 
FAILURE!

   public void testVerifyUnresolved() throws Exception
   {
      OSGiFramework fwOne = createBootstrapProvider().getFramework();
      BundleContext ctxOne = fwOne.getSystemBundleContext();
      
      Bundle bundleA = 
ctxOne.installBundle(getTestArchiveURL("jbosgi37-bundleA.jar").toExternalForm());
      assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
      
      bundleA.start();
      
      OSGiFramework fwTwo = createBootstrapProvider().getFramework();
      BundleContext ctxTwo = fwTwo.getSystemBundleContext();
      
      Bundle bundleB = 
ctxTwo.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
      for (Bundle bundle : ctxTwo.getBundles())
      {
         String symbolicName = bundle.getSymbolicName();
         System.out.println(symbolicName);
      }
      
      Bundle bundleB = 
ctxTwo.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
      
      System.out.println(">>>");
      for (Bundle bundle : ctxTwo.getBundles())
      {
         String symbolicName = bundle.getSymbolicName();
         System.out.println(symbolicName);
      }

      assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
      
      try
      {
         bundleB.start();
         fail("Unresolved constraint expected");
      }
      catch (BundleException ex)
      {
         // expected
      }
   }


> Bundle may start with unresolved packages
> -----------------------------------------
>
>                 Key: FELIX-1040
>                 URL: https://issues.apache.org/jira/browse/FELIX-1040
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-1.4.1, felix-1.6.0
>            Reporter: Thomas Diesler
>         Attachments: jbosgi39-bundleB.jar, jbosgi39-bundleX.jar
>
>
> 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/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to