-
1. Re: PackageAdmin doesn't list [Resolved] bundle packages.
thomas.diesler Jun 27, 2012 3:32 AM (in response to ebelanger070)Ok thanks - I'll have a look. Please monitor
https://issues.jboss.org/browse/JBOSGI-570
In the mean time you might want to add this use case to
Running org.jboss.test.osgi.framework.packageadmin.PackageAdminTestCase
Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.903 sec
or
Running org.jboss.test.osgi.framework.fragments.FragmentTestCase
Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.847 sec
This would help greatly.
git clone git://github.com/jbosgi/jbosgi-framework.git
cd jbosgi-framework
mvn install
-
2. Re: PackageAdmin doesn't list [Resolved] bundle packages.
ebelanger070 Jun 27, 2012 4:10 PM (in response to thomas.diesler)Greetings Thomas,
It took some time, but I figured out how to use the test suites and add my own test. You can look at the file on my github fork.
The test in question is testGetFragmentExportedPackage.
I didn't want to open a pull request since I didn't take the time to match the JBoss code standards and I do not know on which branch this fix should be implemented. So feel free to just take the code
-
3. Re: PackageAdmin doesn't list [Resolved] bundle packages.
thomas.diesler Jun 28, 2012 3:37 AM (in response to ebelanger070)Thanks Eric. I added your test here. The underlying issue is probably that the BundleWiring does not correctly expose capabilities from attached fragments. This is now tested (fails) here
public void testExportedPackageFromFragment() throws Exception { XBundle hostA = (XBundle) installBundle(getHostA()); XBundle fragmentA = (XBundle) installBundle(getFragmentA()); hostA.start(); assertBundleState(Bundle.ACTIVE, hostA.getState()); assertBundleState(Bundle.RESOLVED, fragmentA.getState()); BundleWiring wiring = hostA.getBundleRevision().getWiring(); List<BundleCapability> caps = wiring.getCapabilities(PACKAGE_NAMESPACE); assertEquals("One package capability", 1, caps.size()); assertEquals("org.jboss.osgi.fragment", caps.get(0).getAttributes().get(PACKAGE_NAMESPACE)); }
Please note however that the expected exporter of the package is the host and not the fragment.
The related jira issue is