You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Gierski, Christophe" <Ch...@bmc.com> on 2006/02/28 16:14:04 UTC

Include Junit src test from another project

Hi, 

 

I have two projects A and B, and I would like to execute on my project B
the test case defines on project A.

I have write dependency on project B but when I try to execute test on B
no test were found.

 

    <dependency>

      <groupId>com.bmc.td</groupId>

      <artifactId>vp</artifactId>

      <version>2.0-SNAPSHOT</version>

      <type>test-jar</type>

      <scope>build</scope>

    </dependency>    

 

 

Thanks,

 

--Christophe Gierski


Re: Include Junit src test from another project

Posted by jason r tibbetts <ti...@verdi.iisd.sra.com>.
Emmanuel Venisse wrote:
> You can create a project that contain all tests in src/main/java
> 
> in projects A and B, you add a dependency to "test project" with test 
> scope.
> 
> and finally in src/test/java of projects A and B, you create empty 
> classes that extends classes in "test project".

I take a different approach. I add A's tests to B as unit test 
/resources/. That way they get copied over to B/target/test-classes 
before test:test runs and searches for *Test classes.

>> I have two projects A and B, and I would like to execute on my project B
>> the test case defines on project A.
>>
>> I have write dependency on project B but when I try to execute test on B
>> no test were found.
>>
>>  
>>
>>     <dependency>
>>
>>       <groupId>com.bmc.td</groupId>
>>
>>       <artifactId>vp</artifactId>
>>
>>       <version>2.0-SNAPSHOT</version>
>>
>>       <type>test-jar</type>
>>
>>       <scope>build</scope>
>>
>>     </dependency>   
>>  
>>
>>  
>>
>> Thanks,
>>
>>  
>>
>> --Christophe Gierski
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Include Junit src test from another project

Posted by Emmanuel Venisse <em...@venisse.net>.
You can create a project that contain all tests in src/main/java

in projects A and B, you add a dependency to "test project" with test scope.

and finally in src/test/java of projects A and B, you create empty classes that extends classes in 
"test project".

Emmanuel

Gierski, Christophe a écrit :
> Hi, 
> 
>  
> 
> I have two projects A and B, and I would like to execute on my project B
> the test case defines on project A.
> 
> I have write dependency on project B but when I try to execute test on B
> no test were found.
> 
>  
> 
>     <dependency>
> 
>       <groupId>com.bmc.td</groupId>
> 
>       <artifactId>vp</artifactId>
> 
>       <version>2.0-SNAPSHOT</version>
> 
>       <type>test-jar</type>
> 
>       <scope>build</scope>
> 
>     </dependency>    
> 
>  
> 
>  
> 
> Thanks,
> 
>  
> 
> --Christophe Gierski
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org