maven-surefire-plugin 2.13: test order (know about runOrder)?

2013-02-12 Thread Laird Nelson
Can one control the ordering of test *methods* inside a test class?  I'm
using JUnit 4.11 and Surefire 2.13.

It seems to me from the wording of the runOrder parameter this would be
used to choose what test *classes* to run in what order.

One of our developers is pointing out that Surefire 2.13 seems to have
changed the order that it uses to run methods inside her test class.

While I know and you don't have to tell me that ordering shouldn't be a
property of unit tests, I want to at least understand if it is controllable
or not.

Thanks very much,
Best,
Laird

-- 
http://about.me/lairdnelson


Re: maven-surefire-plugin 2.13: test order (know about runOrder)?

2013-02-12 Thread Andreas Gudian
Hi Laird,

The execution order of the methods within a test class is in control of
Junit itself.

AFAIK, Junit 4.11 contains a change to order the execution of @Test methods
alphabetically by default. [1] has some information on how to control that
behavior. I think what's now called the "JVM" sorting was the default
behavior in previous versions.

[1]
http://www.hascode.com/2012/11/new-features-in-junit-4-11/#Test_Execution_Order

Cheers,
Andreas

Am Dienstag, 12. Februar 2013 schrieb Laird Nelson :

> Can one control the ordering of test *methods* inside a test class?  I'm
> using JUnit 4.11 and Surefire 2.13.
>
> It seems to me from the wording of the runOrder parameter this would be
> used to choose what test *classes* to run in what order.
>
> One of our developers is pointing out that Surefire 2.13 seems to have
> changed the order that it uses to run methods inside her test class.
>
> While I know and you don't have to tell me that ordering shouldn't be a
> property of unit tests, I want to at least understand if it is controllable
> or not.
>
> Thanks very much,
> Best,
> Laird
>
> --
> http://about.me/lairdnelson
>


Re: maven-surefire-plugin 2.13: test order (know about runOrder)?

2013-02-12 Thread Laird Nelson
On Tue, Feb 12, 2013 at 2:43 PM, Andreas Gudian wrote:

> The execution order of the methods within a test class is in control of
> Junit itself.
>

Thanks, Andreas; that explains it.

Best,
Laird
-- 
http://about.me/lairdnelson


Re: maven-surefire-plugin 2.13: test order (know about runOrder)?

2013-02-12 Thread Manfred Moser
> Can one control the ordering of test *methods* inside a test class?  I'm
> using JUnit 4.11 and Surefire 2.13.
>
> It seems to me from the wording of the runOrder parameter this would be
> used to choose what test *classes* to run in what order.
>
> One of our developers is pointing out that Surefire 2.13 seems to have
> changed the order that it uses to run methods inside her test class.
>
> While I know and you don't have to tell me that ordering shouldn't be a
> property of unit tests, I want to at least understand if it is
> controllable
> or not.

If your test methods depend on the order in which they are executed they
should be refactored to be atomic rather than trying to order them via the
test framework.

manfred

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