You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christopher Meyer <ch...@rub.de> on 2011/05/27 18:28:12 UTC

Trouble with attached Tests

Hi users list,
Can someone help me with an unit testing issue?

I'm trying to reuse tests from another project and created a jar as described 
in http://maven.apache.org/guides/mini/guide-attached-tests.html.

I installed the jar and everything is fine to this point...
I thought that the following additions to the project's pom.xml (which should 
use the jar) would cause the test files included in the jar to run.

<dependency>
            <groupId>de.rub.nds</groupId>
            <artifactId>wsPraktikum11-tests</artifactId>
            <version>1.0</version>
            <type>test-jar</type>
            <scope>test</scope>
</dependency>

But when i run "mvn install" or "package" the tests of the external jar are 
not executed.
Do you have any hints for me? Did i get anything wrong?

Regards,
Chris



--
Dipl.-Ing. Christopher Meyer

Chair for Network and Data Security 
Horst Görtz Institute for IT-Security 
Ruhr-University Bochum, Germany

Phone: (+49) (0)234 / 32 - 29815
Fax: (+49) (0)234 / 32 - 14347
_________________________________
Universitätsstr. 150, ID 2/415
D-44801 Bochum, Germany
http:// www.nds.rub.de

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


Re: Trouble with attached Tests

Posted by Christopher Meyer <ch...@rub.de>.
Thanks for your quick responses!
I tried Karl Heinz solution and it worked for me. Actually i extend an 
abstract class containing all my tests which are packed as a jar. The jar is 
added as dependency to my pom.xml.
This works perfect!

Thanks again for your help guys!
Regards from Bochum, Germany,

Chris




On Saturday 28 May 2011 16:35:57 Stephen Connolly wrote:
> or use dependency:unpack-dependencies to put all the test classes in
> target/test classes there is an example of how to do this in the plexus
> utils commons bridge project in the maven sandbox in svn (search the dev
> list for the past week and you should see some threads with the url... I'm
> on a phone so not going to try and copy and pate the url)
> 
> - Stephen
> 
> ---
> Sent from my Android phone, so random spelling mistakes, random nonsense
> words and other nonsense are a direct result of using swype to type on the
> screen
> On 28 May 2011 15:00, "Karl Heinz Marbaise" <kh...@gmx.de> wrote:

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


Re: Trouble with attached Tests

Posted by Stephen Connolly <st...@gmail.com>.
or use dependency:unpack-dependencies to put all the test classes in
target/test classes there is an example of how to do this in the plexus
utils commons bridge project in the maven sandbox in svn (search the dev
list for the past week and you should see some threads with the url... I'm
on a phone so not going to try and copy and pate the url)

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 28 May 2011 15:00, "Karl Heinz Marbaise" <kh...@gmx.de> wrote:

Re: Trouble with attached Tests

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

> I thought that the following additions to the project's pom.xml (which should
> use the jar) would cause the test files included in the jar to run.
You can reuse the classes within file (test-jar) but the tests inside 
this jar will NOT run, cause neither surefire-plugin nor failsafe-plugin 
are able to run tests from within a jar file.

The simplest solution is to create an abstract class which contains the 
tests and make a simple class in your project which derives from that 
abstract class which itself is located in src/test/java ...

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

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