You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Davide Giannella <da...@apache.org> on 2014/08/19 09:17:00 UTC

testing helper

Hello team,

as part of OAK-2035 I had to copy some "helpers" from oak-core to
oak-jcr. I was in a hurry so I copied 
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/util/ValuePathTuple.java
and some functions I pasted in OrderedIndexIT.java.

Now I was thinking what would be a proper way to share, for testing
only, some classes/methods across multiple projects: in the case above
oak-core and oak-jcr?

Cheers
Davide




Re: testing helper

Posted by Felix Meschberger <fm...@adobe.com>.
That’s exactly what I had in mind :-)

Regards
Felix

Am 21.08.2014 um 10:21 schrieb Chetan Mehrotra <ch...@gmail.com>:

> Probably we can package the test classes as an attached artifact and
> make use of that. For example oak-lucene uses the Oak Core test via
> 
> <dependency>
>      <groupId>org.apache.jackrabbit</groupId>
>      <artifactId>oak-core</artifactId>
>      <version>${project.version}</version>
>      <classifier>tests</classifier>
>      <scope>test</scope>
>    </dependency>
> Chetan Mehrotra
> 
> 
> On Thu, Aug 21, 2014 at 1:36 PM, Davide Giannella <da...@apache.org> wrote:
>> On 20/08/2014 10:11, Marcel Reutegger wrote:
>>> oops, you are right, that would be a bad idea. I thought this is about
>>> a production class and not a test utility.
>> I can see an additional bundle like "testing-commons" that can be
>> imported with scope test by other projects.
>> 
>> The pain point in here is that the testing helpers: functions, classes,
>> etc; uses part of the oak-core api (NodeBuilder, NodeState, etc) and
>> without having the exposed API as a bundle but together with the
>> implementation we go in a loop of having oak-core depending on
>> testing-commons and testing-commons depending on oak-core.
>> 
>> D.
>> 
>> 
>> 


Re: testing helper

Posted by Davide Giannella <da...@apache.org>.
On 21/08/2014 09:26, Michael Dürig wrote:
>
>
> On 21.8.14 10:21 , Chetan Mehrotra wrote:
>> Probably we can package the test classes as an attached artifact and
>> make use of that. For example oak-lucene uses the Oak Core test via
>>
>> <dependency>
>>        <groupId>org.apache.jackrabbit</groupId>
>>        <artifactId>oak-core</artifactId>
>>        <version>${project.version}</version>
>>        <classifier>tests</classifier>
>>        <scope>test</scope>
>>      </dependency>
>
> +1. I think we did that elsewhere in the past.
For not loosing track of it https://issues.apache.org/jira/browse/OAK-2046

D.



Re: testing helper

Posted by Michael Dürig <md...@apache.org>.

On 21.8.14 10:21 , Chetan Mehrotra wrote:
> Probably we can package the test classes as an attached artifact and
> make use of that. For example oak-lucene uses the Oak Core test via
>
> <dependency>
>        <groupId>org.apache.jackrabbit</groupId>
>        <artifactId>oak-core</artifactId>
>        <version>${project.version}</version>
>        <classifier>tests</classifier>
>        <scope>test</scope>
>      </dependency>

+1. I think we did that elsewhere in the past.

Michael

> Chetan Mehrotra
>
>
> On Thu, Aug 21, 2014 at 1:36 PM, Davide Giannella <da...@apache.org> wrote:
>> On 20/08/2014 10:11, Marcel Reutegger wrote:
>>> oops, you are right, that would be a bad idea. I thought this is about
>>> a production class and not a test utility.
>> I can see an additional bundle like "testing-commons" that can be
>> imported with scope test by other projects.
>>
>> The pain point in here is that the testing helpers: functions, classes,
>> etc; uses part of the oak-core api (NodeBuilder, NodeState, etc) and
>> without having the exposed API as a bundle but together with the
>> implementation we go in a loop of having oak-core depending on
>> testing-commons and testing-commons depending on oak-core.
>>
>> D.
>>
>>
>>

Re: testing helper

Posted by Chetan Mehrotra <ch...@gmail.com>.
Probably we can package the test classes as an attached artifact and
make use of that. For example oak-lucene uses the Oak Core test via

<dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>oak-core</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
Chetan Mehrotra


On Thu, Aug 21, 2014 at 1:36 PM, Davide Giannella <da...@apache.org> wrote:
> On 20/08/2014 10:11, Marcel Reutegger wrote:
>> oops, you are right, that would be a bad idea. I thought this is about
>> a production class and not a test utility.
> I can see an additional bundle like "testing-commons" that can be
> imported with scope test by other projects.
>
> The pain point in here is that the testing helpers: functions, classes,
> etc; uses part of the oak-core api (NodeBuilder, NodeState, etc) and
> without having the exposed API as a bundle but together with the
> implementation we go in a loop of having oak-core depending on
> testing-commons and testing-commons depending on oak-core.
>
> D.
>
>
>

Re: testing helper

Posted by Davide Giannella <da...@apache.org>.
On 20/08/2014 10:11, Marcel Reutegger wrote:
> oops, you are right, that would be a bad idea. I thought this is about
> a production class and not a test utility.
I can see an additional bundle like "testing-commons" that can be
imported with scope test by other projects.

The pain point in here is that the testing helpers: functions, classes,
etc; uses part of the oak-core api (NodeBuilder, NodeState, etc) and
without having the exposed API as a bundle but together with the
implementation we go in a loop of having oak-core depending on
testing-commons and testing-commons depending on oak-core.

D.




Re: testing helper

Posted by Marcel Reutegger <mr...@adobe.com>.
Hi,

On 20/08/14 10:23, "Felix Meschberger" <fm...@adobe.com> wrote:

>Am 20.08.2014 um 09:43 schrieb Marcel Reutegger <mr...@adobe.com>:
>
>> Hi,
>> 
>> oak-commons might be a good fitŠ
>
>In the test artifact attachment ?
>
>I would suggest not to add test classes to the primary artifact.

oops, you are right, that would be a bad idea. I thought this
is about a production class and not a test utility.

regards
 marcel



Re: testing helper

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Am 20.08.2014 um 09:43 schrieb Marcel Reutegger <mr...@adobe.com>:

> Hi,
> 
> oak-commons might be a good fit…

In the test artifact attachment ?

I would suggest not to add test classes to the primary artifact.

Regards
Felix

> 
> regards
> marcel
> 
> On 19/08/14 09:17, "Davide Giannella" <da...@apache.org> wrote:
> 
>> Hello team,
>> 
>> as part of OAK-2035 I had to copy some "helpers" from oak-core to
>> oak-jcr. I was in a hurry so I copied
>> oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/util/ValuePathTuple.ja
>> va
>> and some functions I pasted in OrderedIndexIT.java.
>> 
>> Now I was thinking what would be a proper way to share, for testing
>> only, some classes/methods across multiple projects: in the case above
>> oak-core and oak-jcr?
>> 
>> Cheers
>> Davide
>> 
>> 
> 


Re: testing helper

Posted by Marcel Reutegger <mr...@adobe.com>.
Hi,

oak-commons might be a good fit...

regards
 marcel

On 19/08/14 09:17, "Davide Giannella" <da...@apache.org> wrote:

>Hello team,
>
>as part of OAK-2035 I had to copy some "helpers" from oak-core to
>oak-jcr. I was in a hurry so I copied
>oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/util/ValuePathTuple.ja
>va
>and some functions I pasted in OrderedIndexIT.java.
>
>Now I was thinking what would be a proper way to share, for testing
>only, some classes/methods across multiple projects: in the case above
>oak-core and oak-jcr?
>
>Cheers
>Davide
>
>