ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <>
Subject Re: run junit tests in a certain order
Date Wed, 26 Nov 2003 07:13:16 GMT
Derive your own class from File
code the listFile() method ordering the way you see fit..
----- Original Message ----- 
From: "J. Xue" <>
To: "Ant Users List" <>
Sent: Tuesday, November 25, 2003 7:49 PM
Subject: run junit tests in a certain order

> I'm sure I'm not the first one having this problem but can't find anything
> google.
> I would like to be able to run some JUnit tests in a certain order, e.g.,
> starting from the most basic ones.  There doesn't seem to be a perfect way
> do this using the <junit> task.  <batchtest> takes a fileset, so the order
> the test files is basically determined by File.listFile(), which returns
> in an OS-specific order.
> For a workaround, I wrote a master test suite, in which I read from a file
> that has the list of test files in the order I want them to run.  I then
> it using <test>.  Now everything works fine as far as order enforcement is
> concerned - but all the test methods are listed under the master test
> class in the report!  So if I have two test methods from different classes
> with the same name, I wouldn't be able to tell which is which.
> Other options include hardcoding the order into build.xml, or hack the
> code for <batchtest> to take a file list.  Neither of those paths smells
> a pleasant solution, though.
> Any hint would be appreciated.
> --J.X.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message