Thank you very much for your help.

Unfortunately I'm still have some problems with services injection.
As I understand I can inject services from o.a.s. jcr.contentloader package.
1. When I try to inject o.a.s. jcr.contentloader.ContentCreator I'm getting
exception: ServiceLookupException: gave up waiting for service
org.apache.sling.jcr.contentloader.ContentCreator. I tried to add
@Filter(timeout=10000L) annotation. But it didn't help me. Tried on Java 6
and 7.

2. When I'm trying to inject o.a.s. jcr.contentloader.ContentCreator I'm
getting exception: java.lang.IllegalArgumentException: Can not set
org.apache.sling.jcr.contentloader.ContentImporter field
org.apache.sling.jcr.contentloader.internal.it.BundleContentLoaderIT.whiteboard
to org.apache.sling.jcr.contentloader.internal.DefaultContentImporter

So the only service which injects fine is
o.a.s.jcr.contentloader.ContentReader.
In logs the only exceptions I found are:

1. org.apache.sling.servlets.post
[org.apache.sling.servlets.post.impl.SlingPostServlet(66)] The
unbindContentImporter method has thrown an exception
(java.lang.IllegalArgumentException: argument type mismatch)

2. org.apache.sling.servlets.post
[org.apache.sling.servlets.post.impl.SlingPostServlet(66)] The
bindContentImporter method has thrown an exception
(java.lang.IllegalArgumentException: argument type mismatch)

Have some of you ever faced with same problem?

Thank you so much,
Petr

2015-06-22 18:34 GMT+03:00 Robert Munteanu <[email protected]>:

> On Mon, 2015-06-22 at 16:02 +0300, Petr Shypila wrote:
> > Thanks for everyone.
> >
> > So as I understand for now Sling Mocks is the preferable and most
> > modern
> > way to write unit tests. Is that correct?
> > What about JCR data store? Does it save data between tests and should
> > take
> > care of that?
>
> It depends on each provider implementation. The JCR_JACKRABBIT resource
> provider type saves the data between runs, while the JCR_OAK one does
> not.
>
> Robert
>

Reply via email to