Cheers for the reply Philippe.

Cool, didn't know you could do that. I am guessing that you need to run the
maven jar:test-jar goal to create the test jar? (The generates an error for
me?)

My original idea was to create a brand new sub project that would handle all
unit tests, so it could share resources (DB connections, parsed XML files
etc...) more easily. Would it make sense to use this approach?

Or would this create more hassle than its worth?

Robert



Philippe Faes wrote:
> 
> Rob,
> 
> You can make the test classes of one project visible in the test phase
> of another project:
> 
>     <dependency>
>       <groupId>com.example</groupId>
>       <artifactId>someArtifact</artifactId>
>       <version>0.1.1-SNAPSHOT</version>
>       <type>test-jar</type>
>       <scope>test</scope>
>     </dependency>
> 
> greets,
> Philippe
> 
> On Mon, 2006-10-09 at 06:10 -0700, RobertK wrote:
>> Hi,
>> 
>> first off, using maven 1.0.2 multiproject to build, test and deploy about
>> 8
>> sub-projects. Everything working there smoothly (got to love Maven! :) )
>> 
>> Now my question, many of my projects repeat the same unit test or data,
>> so
>> the whole project suffers from the annoying / untidy symptom of "copy and
>> paste". So what I am wondering, is there an easier (cleaner) way to do
>> it?
>> 
>> Example, I have 43 Tester.java classes for testing various different
>> packages. Each one of them has the following code,
>> 
>> public Tester(String a_name)
>>     {
>>         super(a_name);
>>     }
>> 
>>     /**
>>      * Run all tests in this package.
>>      * 
>>      * @param args
>>      */
>>     public static void main(String[] args)
>>     {
>>         junit.textui.TestRunner.run(suite());
>>     }
>> 
>> 
>> I mean, there must be a better way? There are over 500 unit tests in the
>> projects, so having one giant test suite is out of the question. Need
>> some
>> sort of strategy to make common utility classes available to multiple
>> project and allow some form of inheritance from a base class.
>> 
>> I have some ideas, but really looking for alternatives, see if any one
>> can
>> think of a better way. So does any one have any suggestions?
>> 
>> Cheers,
>> Rob
> -- 
> ir. Philippe Faes
> Ghent University - Department ELIS
> Sint-Pietersnieuwstraat 41 -- B-9000 Gent
> Tel:+32 9 264 95 25 - Fax:+32 9 264 35 94
>     http://www.elis.UGent.be/~pfaes
> ON5DEU   --   LPIC1  --  gpg-key:173720B6
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Maven-multiproject%2C-test-inheritance-tf2409917.html#a6719634
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to