You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Simone Tripodi <si...@apache.org> on 2012/12/17 21:09:07 UTC

Testing queries in jackrabbit-jcr-commons

Hi all guys!

I am working on a patch to be contributed on JCR-3487 and I didn't
find a way, in tests, how to obtain a repository where adding nodes
and than execute queries - do you have any hint?

Many thanks in advance, all the best!
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

Re: Testing queries in jackrabbit-jcr-commons

Posted by Simone Tripodi <si...@apache.org>.
Hi Justin,
thanks for the prompt reply!

In my test I was trying to add some nodes to the repository and then
querying it with the new APIs in order to verify results are get in
the right way...

Maybe I should switch to a different strategy? Do you have any hint?
Many thanks in advance, all the best!
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/


On Mon, Dec 17, 2012 at 9:43 PM, Justin Edelson
<ju...@justinedelson.com> wrote:
> Simone-
> I don't think the structure of the JR codebase would permit this.
> jcr-commons is a dependency of jackrabbit-core, so starting a repository
> from a jcr-commons test would create a circular dependency (unless it was to
> an older version of jackrabbit-core, which no doubts creates other issues).
>
> I guess we need a separate module named
> jackrabbit-jcr-commons-integration-tests.
>
> Is there a reason you can't test with mocks?
>
> Regards,
> Justin
>
>
> On Mon, Dec 17, 2012 at 3:09 PM, Simone Tripodi <si...@apache.org>
> wrote:
>>
>> Hi all guys!
>>
>> I am working on a patch to be contributed on JCR-3487 and I didn't
>> find a way, in tests, how to obtain a repository where adding nodes
>> and than execute queries - do you have any hint?
>>
>> Many thanks in advance, all the best!
>> -Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://simonetripodi.livejournal.com/
>> http://twitter.com/simonetripodi
>> http://www.99soft.org/
>
>

RE: Testing queries in jackrabbit-jcr-commons

Posted by Marcel Reutegger <mr...@adobe.com>.
> On Mon, Dec 17, 2012 at 10:43 PM, Justin Edelson
> <ju...@justinedelson.com> wrote:
> > I guess we need a separate module named
> > jackrabbit-jcr-commons-integration-tests.
> 
> Right. We tried using some dependency version/scope tricks to get
> around the need for a separate test component, but that didn't work
> out, see [1] and [2] for the details.

integration tests for jackrabbit-jcr-commons are currently in
jackrabbit-core. I'd say that's currently the easiest way to add tests,
since all jackrabbit modules have the same snapshot version.

regards
 marcel

Re: Testing queries in jackrabbit-jcr-commons

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Mon, Dec 17, 2012 at 10:43 PM, Justin Edelson
<ju...@justinedelson.com> wrote:
> I guess we need a separate module named
> jackrabbit-jcr-commons-integration-tests.

Right. We tried using some dependency version/scope tricks to get
around the need for a separate test component, but that didn't work
out, see [1] and [2] for the details.

[1] https://issues.apache.org/jira/browse/JCR-2688?focusedCommentId=12894855&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12894855
[1] https://issues.apache.org/jira/browse/JCR-2692?focusedCommentId=12895234&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12895234

BR,

Jukka Zitting

Re: Testing queries in jackrabbit-jcr-commons

Posted by Justin Edelson <ju...@justinedelson.com>.
Simone-
I don't think the structure of the JR codebase would permit this.
jcr-commons is a dependency of jackrabbit-core, so starting a repository
from a jcr-commons test would create a circular dependency (unless it was
to an older version of jackrabbit-core, which no doubts creates other
issues).

I guess we need a separate module named
jackrabbit-jcr-commons-integration-tests.

Is there a reason you can't test with mocks?

Regards,
Justin


On Mon, Dec 17, 2012 at 3:09 PM, Simone Tripodi <si...@apache.org>wrote:

> Hi all guys!
>
> I am working on a patch to be contributed on JCR-3487 and I didn't
> find a way, in tests, how to obtain a repository where adding nodes
> and than execute queries - do you have any hint?
>
> Many thanks in advance, all the best!
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>