JUnit tests never run in a specific order and you are stongly advised never to depend upon their execution order.

if it worked for you at all that is just a lucky fluke

Kind regards,
Dave Sag




 


Jochen Wiedmann <[EMAIL PROTECTED]> wrote on 13-12-2005 16:21:44:

> Hi,
>
> I have a test suite that depends on a certain order of tests. More
> precisely, a unit test, which looks like
>
>     public class MyTest extends TestCase {
>         public void testFoo(){ ... }
>         public void testBar(){ ... }
>     }
>
> assumes, that testFoo() is invoked before testBar(). This works fine,
> when running the tests from within Ant, or Eclipse.
>
> My impression is, that Surefire doesn't keep this order. Can anyone
> confirm this? I assume, that reordering the methods is intentional?
> However, if so, two questions arise to me:
>
> - A reordering occurs, both for test classes (which are typically executed in
>   alphabetical orders by other frameworks), and methods. However, the reorder
>   doesn't look choosen randomly: It is reproducable.
>
>   But if the desired effect is to stop the user from assuming a
> certain order, why
>   isn't it random?
>
> - Would it be possibly to accept a patch, which restores the typical
> order on the users
>   behalf (for example, by setting a property "canonicalOrder")? The
> test suite isn't
>   written by me, and I am almost unable to change it.
>
>
> Thanks,
>
> Jochen
>
>
> --
> Often it does seem a pity that Noah and his party did not miss the
> boat. (Mark Twain)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to