You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jakub Pawlowicz <co...@jakubpawlowicz.com> on 2006/04/09 16:32:09 UTC

[M2] surefire plugin and JUnit 4

Hi,

Does anybody know if there's a way to use JUnit 4 with maven-surefire- 
plugin?
It seems that classes which are using the JUnit 4 (annotations etc)  
are not executed using the standard 'mvn test' command.

The surefire plugin has a direct dependency on JUnit 3.8.1, so I  
guess there is the problem.
But I don't know if there's a way to change it (in my pom.xml) to  
JUnit 4.

I'm using Maven 2.0.3 and maven-surefire-plugin 2.1.3 and have all  
sources compiled for Java 5.

Thanks in advance.
Best regards,
Jakub Pawlowicz

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


Re: [M2] surefire plugin and JUnit 4

Posted by Jakub Pawlowicz <co...@jakubpawlowicz.com>.
Thanks Wayne & Brett.
Now, my tests runs in Eclipse without a hitch. :-)
However, I'm eagerly waiting to see them working directly from maven  
(with the maven-surefire-plugin 2.2).
I hope it won't take too long.

Best regards,
Jakub


On Apr 10, 2006, at 2:37 AM, Brett Porter wrote:

> Support has been submitted (but not yet tested) and is likely to be
> included in surefire plugin 2.2, along with the already implemented
> and tested testNG support.
>
> In the mean time, you might try this technique:
> http://www.jroller.com/page/eu?entry=running_junit_4_test_cases
>
> - Brett
>
> On 4/10/06, Jakub Pawlowicz <co...@jakubpawlowicz.com> wrote:
>> Hi,
>>
>> Does anybody know if there's a way to use JUnit 4 with maven- 
>> surefire-
>> plugin?
>> It seems that classes which are using the JUnit 4 (annotations etc)
>> are not executed using the standard 'mvn test' command.
>>
>> The surefire plugin has a direct dependency on JUnit 3.8.1, so I
>> guess there is the problem.
>> But I don't know if there's a way to change it (in my pom.xml) to
>> JUnit 4.
>>
>> I'm using Maven 2.0.3 and maven-surefire-plugin 2.1.3 and have all
>> sources compiled for Java 5.
>>
>> Thanks in advance.
>> Best regards,
>> Jakub Pawlowicz
>>
>> ---------------------------------------------------------------------
>> 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
>
>


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


Re: [M2] surefire plugin and JUnit 4

Posted by Wayne Fay <wa...@gmail.com>.
First off, here's a good "junit 4.0 in just 10 minutes" tutorial. It
also includes details on running JUnit4 tests in JUnit3:
http://www.instrumentalservices.com/content/view/45/52/

This topic has been discussed on the JUnit Yahoogroup email list, so
I'd suggest taking a look there for more examples... But the general
idea is covered on that jroller blog post Brett linked aka use
JUnitTestAdapters.

Wayne

On 4/9/06, Brett Porter <br...@gmail.com> wrote:
> Support has been submitted (but not yet tested) and is likely to be
> included in surefire plugin 2.2, along with the already implemented
> and tested testNG support.
>
> In the mean time, you might try this technique:
> http://www.jroller.com/page/eu?entry=running_junit_4_test_cases
>
> - Brett
>
> On 4/10/06, Jakub Pawlowicz <co...@jakubpawlowicz.com> wrote:
> > Hi,
> >
> > Does anybody know if there's a way to use JUnit 4 with maven-surefire-
> > plugin?
> > It seems that classes which are using the JUnit 4 (annotations etc)
> > are not executed using the standard 'mvn test' command.
> >
> > The surefire plugin has a direct dependency on JUnit 3.8.1, so I
> > guess there is the problem.
> > But I don't know if there's a way to change it (in my pom.xml) to
> > JUnit 4.
> >
> > I'm using Maven 2.0.3 and maven-surefire-plugin 2.1.3 and have all
> > sources compiled for Java 5.
> >
> > Thanks in advance.
> > Best regards,
> > Jakub Pawlowicz
> >
> > ---------------------------------------------------------------------
> > 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: [M2] surefire plugin and JUnit 4

Posted by Brett Porter <br...@gmail.com>.
Support has been submitted (but not yet tested) and is likely to be
included in surefire plugin 2.2, along with the already implemented
and tested testNG support.

In the mean time, you might try this technique:
http://www.jroller.com/page/eu?entry=running_junit_4_test_cases

- Brett

On 4/10/06, Jakub Pawlowicz <co...@jakubpawlowicz.com> wrote:
> Hi,
>
> Does anybody know if there's a way to use JUnit 4 with maven-surefire-
> plugin?
> It seems that classes which are using the JUnit 4 (annotations etc)
> are not executed using the standard 'mvn test' command.
>
> The surefire plugin has a direct dependency on JUnit 3.8.1, so I
> guess there is the problem.
> But I don't know if there's a way to change it (in my pom.xml) to
> JUnit 4.
>
> I'm using Maven 2.0.3 and maven-surefire-plugin 2.1.3 and have all
> sources compiled for Java 5.
>
> Thanks in advance.
> Best regards,
> Jakub Pawlowicz
>
> ---------------------------------------------------------------------
> 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