Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Christian Schneider
If found a workaround by extracting the repository logic into a separate class that I replace with a dummy in OSGi. So I currently test the repository logic outside OSGi. I think we can improve the situation though. How about making org.apache.sling.testing.resourceresolver-mock a bundle? This

Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Oliver Lietz
On Wednesday, March 4, 2020 11:59:32 AM CET Bertrand Delacretaz wrote: > Hi, Hi, > On Wed, Mar 4, 2020 at 11:03 AM Christian Schneider > > wrote: > > ...Now I also need to change nodes in the repository. Is there a way to > > test this without the full sling pax exam testing?.. Do you need a

Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Oliver Lietz
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

Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Carsten Ziegeler
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 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

Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Bertrand Delacretaz
Hi, On Wed, Mar 4, 2020 at 11:03 AM Christian Schneider wrote: > ...Now I also need to change nodes in the repository. Is there a way to test > this without the full sling pax exam testing?.. You might "manually" setup just the bundles that you need to get a ResourceResolverFactory service, but

Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Christian Schneider
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.

Re: Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Carsten Ziegeler
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

Mock resource resolver factory for use in OSGi?

2020-03-04 Thread Christian Schneider
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