dev@glassfish.java.net

Re: randomize junit test order

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Sat, 25 Feb 2012 16:24:16 -0800

Bobby Bissett wrote on 02/25/2012 03:34 PM:
> On Sat, Feb 25, 2012 at 6:16 PM, Andreas Loew<Andreas.Loew_at_oracle.com> wrote:
>>
>> Base line: IMO, you must fix the test and remove the state dependency
>> between its methods [...]
>
> I think that's *exactly* what Bill wants to do. Running the tests in
> random order could tell us which tests need to be fixed.

Yup.

> Frankly, if junit tests are really supposed to be order-independent,
> junit ought to randomize them by default so people can't easily write
> buggy tests.

I agree.