dev@glassfish.java.net

Re: randomize junit test order

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Sat, 25 Feb 2012 20:17:23 -0600

Yes. The Class.getMethods javadoc has always said that the return value was not in any particular order, but the previously, the order was predictable. Now, the order is not. It's based on what has happened with the symbol table.

Tom



On Feb 25, 2012, at 7:13 PM, Andreas Loew <Andreas.Loew_at_oracle.com> wrote:

> 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... :-(
>
> BR,
>
> Andreas
>
> --
> Andreas Loew | Senior Java Architect
> ACS Principal Service Delivery Engineer
> ORACLE Deutschland B.V.& Co. KG
>
>
>