Closed sjsf closed 6 years ago
PS: The best I could find is this from BundleWiring.listResources(...)
's JavaDoc:
Returns the names of resources visible to this bundle wiring's class loader
As the stuff within the JARs is visible to the class loader, my assumption was that it should work.
Thanks for reporting. I will check if we can change this and Tim needs to check if it breaks any of the TCK tests if we do but if you say that Equinox exposes embedded JARs this way then I would hope that it does not.
@sjka thanks for reporting that, and your test case. @rellermeyer @tverbele I will run the test case and try to fix it. I will also run again the TCK to sure that we do NOT break any existing tests.
I added a PR now to fix this issue. I also re-run the TCK. There is the same test case failing as before doing the change.
The failing test case is related to a somehow related problem:
org.osgi.test.cases.framework.junit.wiring.BundleWiringTests.testListResources
I will look into that further on. But the test case from @sjka does work now.
@rellermeyer Can you do a careful review of that?
When asking a bundle for its contained resources via
bundle.adapt(BundleWiring.class).listResources(...)
, the content of embedded JARs is not considered.I have to admit that so far I couldn't spot anything in the OSGi specs which explicitly states that it should do so - I merely noticed that this works on equinox. I have a corresponding test case in sjka/concierge@testListResources.
I'd be happy if any of you experts could have a quick look and advise on this.