dev@glassfish.java.net

Re: randomize junit test order

From: Romain Grécourt <romain.grecourt_at_oracle.com>
Date: Sun, 26 Feb 2012 04:07:12 +0100

Le 26/02/12 02:13, Andreas Loew a écrit :
> Am 26.02.2012 02:07, schrieb Tom Mueller:
>> Note that randomized order is what you get with Java SE 1.7.0_02 and
>> later. This is why we are seeing some seemingly random unit test
>> failures when we build with Java SE 7.
> Ouch! Why is that? Is that because the Reflection API implementation
> is now returning "testXXX()" methods in *random* instead of *fixed,
> but arbitrary* order?
>
> If yes, then I'd tend to call this a JDK bug... :-(
According to
http://www.oracle.com/technetwork/java/javase/compatibility-417013.html#jdk7:
the order of methods returned by Class.get methods can vary. There is
also a link to the following bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7023180.

Romain
>
> BR,
>
> Andreas
>