ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: Sorting filesets
Date Mon, 14 Oct 2002 23:01:13 GMT

----- Original Message -----
From: "Eric Jablow" <>
To: "'Ant Users List'" <>
Sent: Monday, October 14, 2002 11:24 AM
Subject: RE: Sorting filesets

> > From: Tom Lipkis []
> > Sent: Monday, October 14, 2002 12:57 PM
> > To:
> > Subject: Sorting filesets
> > I'm trying to find a way to run JUnit test classes in a
> > particular order, which is determined by some property of
> > each class.  I was easily able to pick a subset of test
> Typically, you don't want to do this. Tests should be
> independent of each other.  JUnit does not guarantee the
> order it will run tests within a Test class, and I don't
> think Ant guarantees the order it will run tests.

It tends to run them in order test1, test2, etc. but that may be an artifact
of how the JVM runtime, rather than junit itself.

> If you need to run a set of tests in a specific order, you
> can construct a test suite by hand in a Java file.  If you
> want to be able to run a single test, you can use the
> technique in Hatcher and Loughran's book on page 103.

My thoughts exactly :)

Actually I am doing some project now where a fair few tests only work when
the system is on a net, so for all to work well on the laptop I have a
pattern Net* for those tasks to exclude when offline=true; patterns
are your friend when it comes to managing tests.

> If you're writing tests that depend on ordering, don't.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message