You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Billy Newman <ne...@gmail.com> on 2012/08/10 18:35:29 UTC

Running tests from a maven test-jar

I have a test jar out there that test some main functionality of an api.  I
would like to run that suite of tests for all my impl artifacts.

I have deployed it as a test-jar and I have the dependency setup for my
impl project to depend on that test-jar.  However this just pull the jar in
at 'test' time it does not execute the tests.

I found this post from a while back:
http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html

Wondering if this is still the accepted/right way to do what I want.

Thanks

Re: Running tests from a maven test-jar

Posted by Billy Newman <ne...@gmail.com>.
Perfect that will work just fine. Thanks!

Sent from my iPhone

On Aug 11, 2012, at 5:49 AM, Stephen Connolly <st...@gmail.com> wrote:

> Surefire does not currently run tests in test-jar dependencies. The best
> option for now is to use dependency:unpack-dependencies and
> build-helper:attach-test-classes
> 
> On Friday, 10 August 2012, Ansgar Konermann wrote:
> 
>> You could try this: configure m-surefire-p and replace the default,
>> ant-style include with a regex include (regex matching is done over classes
>> instead of java files).
>> Am 10.08.2012 19:55 schrieb "Billy Newman" <newmanw10@gmail.com<javascript:;>
>>> :
>> 
>>> Agreed that is exactly what i am doing , but that will not actually run
>>> that suite of unit tests against my code. It just pulls it in as a
>>> dependency.
>>> 
>>> Again is the link I provided the best way to pull in a test-jar and
>>> actually run its tests against another artifact?
>>> 
>>> Thanks again!
>>> 
>>> Sent from my iPhone
>>> 
>>> On Aug 10, 2012, at 10:57 AM, Ansgar Konermann <
>>> ansgar.konermann@googlemail.com <javascript:;>> wrote:
>>> 
>>>> Found this in the docs:
>>>> 
>>>> http://maven.apache.org/guides/mini/guide-attached-tests.html
>>>> 
>>>> HTH
>>>> 
>>>> Ansgar
>>>> Am 10.08.2012 18:36 schrieb "Billy Newman" <newmanw10@gmail.com<javascript:;>
>>> :
>>>> 
>>>>> I have a test jar out there that test some main functionality of an
>>> api.  I
>>>>> would like to run that suite of tests for all my impl artifacts.
>>>>> 
>>>>> I have deployed it as a test-jar and I have the dependency setup for
>> my
>>>>> impl project to depend on that test-jar.  However this just pull the
>>> jar in
>>>>> at 'test' time it does not execute the tests.
>>>>> 
>>>>> I found this post from a while back:
>>>>> 
>>>>> 
>>> 
>> http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html
>>>>> 
>>>>> Wondering if this is still the accepted/right way to do what I want.
>>>>> 
>>>>> Thanks
>>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org<javascript:;>
>>> For additional commands, e-mail: users-help@maven.apache.org<javascript:;>
>>> 
>>> 
>> 

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


Re: Running tests from a maven test-jar

Posted by Stephen Connolly <st...@gmail.com>.
Surefire does not currently run tests in test-jar dependencies. The best
option for now is to use dependency:unpack-dependencies and
build-helper:attach-test-classes

On Friday, 10 August 2012, Ansgar Konermann wrote:

> You could try this: configure m-surefire-p and replace the default,
> ant-style include with a regex include (regex matching is done over classes
> instead of java files).
> Am 10.08.2012 19:55 schrieb "Billy Newman" <newmanw10@gmail.com<javascript:;>
> >:
>
> > Agreed that is exactly what i am doing , but that will not actually run
> > that suite of unit tests against my code. It just pulls it in as a
> > dependency.
> >
> > Again is the link I provided the best way to pull in a test-jar and
> > actually run its tests against another artifact?
> >
> > Thanks again!
> >
> > Sent from my iPhone
> >
> > On Aug 10, 2012, at 10:57 AM, Ansgar Konermann <
> > ansgar.konermann@googlemail.com <javascript:;>> wrote:
> >
> > > Found this in the docs:
> > >
> > > http://maven.apache.org/guides/mini/guide-attached-tests.html
> > >
> > > HTH
> > >
> > > Ansgar
> > > Am 10.08.2012 18:36 schrieb "Billy Newman" <newmanw10@gmail.com<javascript:;>
> >:
> > >
> > >> I have a test jar out there that test some main functionality of an
> > api.  I
> > >> would like to run that suite of tests for all my impl artifacts.
> > >>
> > >> I have deployed it as a test-jar and I have the dependency setup for
> my
> > >> impl project to depend on that test-jar.  However this just pull the
> > jar in
> > >> at 'test' time it does not execute the tests.
> > >>
> > >> I found this post from a while back:
> > >>
> > >>
> >
> http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html
> > >>
> > >> Wondering if this is still the accepted/right way to do what I want.
> > >>
> > >> Thanks
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org<javascript:;>
> > For additional commands, e-mail: users-help@maven.apache.org<javascript:;>
> >
> >
>

Re: Running tests from a maven test-jar

Posted by Ansgar Konermann <an...@googlemail.com>.
You could try this: configure m-surefire-p and replace the default,
ant-style include with a regex include (regex matching is done over classes
instead of java files).
Am 10.08.2012 19:55 schrieb "Billy Newman" <ne...@gmail.com>:

> Agreed that is exactly what i am doing , but that will not actually run
> that suite of unit tests against my code. It just pulls it in as a
> dependency.
>
> Again is the link I provided the best way to pull in a test-jar and
> actually run its tests against another artifact?
>
> Thanks again!
>
> Sent from my iPhone
>
> On Aug 10, 2012, at 10:57 AM, Ansgar Konermann <
> ansgar.konermann@googlemail.com> wrote:
>
> > Found this in the docs:
> >
> > http://maven.apache.org/guides/mini/guide-attached-tests.html
> >
> > HTH
> >
> > Ansgar
> > Am 10.08.2012 18:36 schrieb "Billy Newman" <ne...@gmail.com>:
> >
> >> I have a test jar out there that test some main functionality of an
> api.  I
> >> would like to run that suite of tests for all my impl artifacts.
> >>
> >> I have deployed it as a test-jar and I have the dependency setup for my
> >> impl project to depend on that test-jar.  However this just pull the
> jar in
> >> at 'test' time it does not execute the tests.
> >>
> >> I found this post from a while back:
> >>
> >>
> http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html
> >>
> >> Wondering if this is still the accepted/right way to do what I want.
> >>
> >> Thanks
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Running tests from a maven test-jar

Posted by Martin Gainty <mg...@hotmail.com>.
Bill

2 quick questions:
1)are your tests located in src/test/java folder?
2)is each Testcase declared public  and does each TestCase extend junit.framework.TestCase?

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> Subject: Re: Running tests from a maven test-jar
> From: newmanw10@gmail.com
> Date: Fri, 10 Aug 2012 11:55:03 -0600
> To: users@maven.apache.org
> 
> Agreed that is exactly what i am doing , but that will not actually run that suite of unit tests against my code. It just pulls it in as a dependency. 
> 
> Again is the link I provided the best way to pull in a test-jar and actually run its tests against another artifact?
> 
> Thanks again!
> 
> Sent from my iPhone
> 
> On Aug 10, 2012, at 10:57 AM, Ansgar Konermann <an...@googlemail.com> wrote:
> 
> > Found this in the docs:
> > 
> > http://maven.apache.org/guides/mini/guide-attached-tests.html
> > 
> > HTH
> > 
> > Ansgar
> > Am 10.08.2012 18:36 schrieb "Billy Newman" <ne...@gmail.com>:
> > 
> >> I have a test jar out there that test some main functionality of an api.  I
> >> would like to run that suite of tests for all my impl artifacts.
> >> 
> >> I have deployed it as a test-jar and I have the dependency setup for my
> >> impl project to depend on that test-jar.  However this just pull the jar in
> >> at 'test' time it does not execute the tests.
> >> 
> >> I found this post from a while back:
> >> 
> >> http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html
> >> 
> >> Wondering if this is still the accepted/right way to do what I want.
> >> 
> >> Thanks
> >> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
 		 	   		  

Re: Running tests from a maven test-jar

Posted by Billy Newman <ne...@gmail.com>.
Agreed that is exactly what i am doing , but that will not actually run that suite of unit tests against my code. It just pulls it in as a dependency. 

Again is the link I provided the best way to pull in a test-jar and actually run its tests against another artifact?

Thanks again!

Sent from my iPhone

On Aug 10, 2012, at 10:57 AM, Ansgar Konermann <an...@googlemail.com> wrote:

> Found this in the docs:
> 
> http://maven.apache.org/guides/mini/guide-attached-tests.html
> 
> HTH
> 
> Ansgar
> Am 10.08.2012 18:36 schrieb "Billy Newman" <ne...@gmail.com>:
> 
>> I have a test jar out there that test some main functionality of an api.  I
>> would like to run that suite of tests for all my impl artifacts.
>> 
>> I have deployed it as a test-jar and I have the dependency setup for my
>> impl project to depend on that test-jar.  However this just pull the jar in
>> at 'test' time it does not execute the tests.
>> 
>> I found this post from a while back:
>> 
>> http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html
>> 
>> Wondering if this is still the accepted/right way to do what I want.
>> 
>> Thanks
>> 

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


Re: Running tests from a maven test-jar

Posted by Ansgar Konermann <an...@googlemail.com>.
Found this in the docs:

http://maven.apache.org/guides/mini/guide-attached-tests.html

HTH

Ansgar
Am 10.08.2012 18:36 schrieb "Billy Newman" <ne...@gmail.com>:

> I have a test jar out there that test some main functionality of an api.  I
> would like to run that suite of tests for all my impl artifacts.
>
> I have deployed it as a test-jar and I have the dependency setup for my
> impl project to depend on that test-jar.  However this just pull the jar in
> at 'test' time it does not execute the tests.
>
> I found this post from a while back:
>
> http://softwaremavens.blogspot.com/2009/09/running-tests-from-maven-test-jar-in.html
>
> Wondering if this is still the accepted/right way to do what I want.
>
> Thanks
>