On Wednesday, March 4, 2020 12:01:41 PM CET Carsten Ziegeler wrote: > ok, i see...I would assume there is some pax magic to include the > testing jar as a bundle and then you just register the mock as a service
You can of course wrap the JAR and use it with a base Sling from Testing PaxExam and register the mock as service. Regards, O. > Regards > Carsten > > On 04.03.2020 11:28, Christian Schneider wrote: > > 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