Testing the config admin functionality outside of OSGi is not very reliable as it misses many possible error cases. My current tests that involve config admin already use OSGi. Now that I added a @Reference ResourceResolverFactory my OSGi tests of course stopped working as it can not be found.
Christian Am Mi., 4. März 2020 um 11:04 Uhr schrieb Carsten Ziegeler < cziege...@apache.org>: > If you just need config admin and a RRF, why do you need OSGi for the test? > > Carsten > > On 04.03.2020 11:02, Christian Schneider wrote: > > I am currently working on a small bundle that will run in sling. It needs > > only config admin and ResourceResolverFactory. > > > > For the tests I am currently using plain pax exam. I started with just > the > > need for config admin. > > Now I also need to change nodes in the repository. Is there a way to test > > this without the full sling pax exam testing? > > > > I thought about exporting a mock ResourceResolverFactory as a service > > but org.apache.sling.testing.resourceresolver-mock > > is not even a bundle. > > So I can not use it in OSGi. > > > > Is there any easy way to use a mock ResourceResolverFactory in OSGi? > > > > Christian > > > > -- > -- > Carsten Ziegeler > Adobe Research Switzerland > cziege...@apache.org > -- -- Christian Schneider http://www.liquid-reality.de Computer Scientist http://www.adobe.com