You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by SiSi'mon <s_...@purpleblade.net> on 2007/05/31 23:26:38 UTC

Maven surefire question

As I understand it, typically when a JUnit test fails, you want it to stop
right there and report the error (and not continue running tests).

However in some code I recently inherited using the Maven surefire plugin, a
test fails and it keeps going, and going and going and in the end reports 40
test failures.

How do I make it stop and shut down on the first test failure?

thanks

Si'mon
-- 
View this message in context: http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10902420
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Maven surefire question

Posted by Thierry Lach <th...@gmail.com>.
Is each of these in a different testmethod within a single class, such as
testFirst(), testSecond() ?  If so, then this is the standard behavior of
JUnit.  Each method is considered to be a test and will fail, but the class
may contain multiple tests.

On 5/31/07, SiSi'mon <s_...@purpleblade.net> wrote:
>
>
> As I understand it, typically when a JUnit test fails, you want it to stop
> right there and report the error (and not continue running tests).
>
> However in some code I recently inherited using the Maven surefire plugin,
> a
> test fails and it keeps going, and going and going and in the end reports
> 40
> test failures.
>
> How do I make it stop and shut down on the first test failure?
>
> thanks
>
> Si'mon
> --
> View this message in context:
> http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10902420
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven surefire question

Posted by James Abley <ja...@gmail.com>.
On 01/06/07, SiSi'mon <s_...@purpleblade.net> wrote:
>
>
> I am not sure I understand.  I want to shut down and cause a ripple effect
> so
> that no other tests run.
>
> Si'Simon


It sounds like you want something like the ANT Junit task haltonerror /
haltonfailure attribute. I don't know of a way of doing this with maven[1];
there doesn't appear to be an equivalent setting. Perhaps you need to raise
a feature request in JIRA[2] if you really need this functionality.

My previous point was that the failure of one test should not cause the
failure of lots of other tests: tests should  be small and isolated.

Cheers,

James

[1] http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html
[2] http://jira.codehaus.org/browse/SUREFIRE

James Abley-2 wrote:
> >
> > On 31/05/07, SiSi'mon <s_...@purpleblade.net> wrote:
> >>
> >>
> >> As I understand it, typically when a JUnit test fails, you want it to
> >> stop
> >> right there and report the error (and not continue running tests).
> >>
> >> However in some code I recently inherited using the Maven surefire
> >> plugin,
> >> a
> >> test fails and it keeps going, and going and going and in the end
> reports
> >> 40
> >> test failures.
> >>
> >> How do I make it stop and shut down on the first test failure?
> >
> >
> >
> > Alter the tests so that they are isolated and a failure in one does not
> > cause a ripple effect.
> >
> >
> > thanks
> >>
> >> Si'mon
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10902420
> >> Sent from the Maven - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10916316
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven surefire question

Posted by SiSi'mon <s_...@purpleblade.net>.
I am not sure I understand.  I want to shut down and cause a ripple effect so
that no other tests run.

Si'Simon


James Abley-2 wrote:
> 
> On 31/05/07, SiSi'mon <s_...@purpleblade.net> wrote:
>>
>>
>> As I understand it, typically when a JUnit test fails, you want it to
>> stop
>> right there and report the error (and not continue running tests).
>>
>> However in some code I recently inherited using the Maven surefire
>> plugin,
>> a
>> test fails and it keeps going, and going and going and in the end reports
>> 40
>> test failures.
>>
>> How do I make it stop and shut down on the first test failure?
> 
> 
> 
> Alter the tests so that they are isolated and a failure in one does not
> cause a ripple effect.
> 
> 
> thanks
>>
>> Si'mon
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10902420
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10916316
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Maven surefire question

Posted by James Abley <ja...@gmail.com>.
On 31/05/07, SiSi'mon <s_...@purpleblade.net> wrote:
>
>
> As I understand it, typically when a JUnit test fails, you want it to stop
> right there and report the error (and not continue running tests).
>
> However in some code I recently inherited using the Maven surefire plugin,
> a
> test fails and it keeps going, and going and going and in the end reports
> 40
> test failures.
>
> How do I make it stop and shut down on the first test failure?



Alter the tests so that they are isolated and a failure in one does not
cause a ripple effect.


thanks
>
> Si'mon
> --
> View this message in context:
> http://www.nabble.com/Maven-surefire-question-tf3848991s177.html#a10902420
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>