J. Xue
2003-11-26 00:49:59 UTC
I'm sure I'm not the first one having this problem but can't find anything on
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 to
do this using the <junit> task. <batchtest> takes a fileset, so the order of
the test files is basically determined by File.listFile(), which returns files
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 run
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 suite
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 source
code for <batchtest> to take a file list. Neither of those paths smells like
a pleasant solution, though.
Any hint would be appreciated.
--J.X.
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 to
do this using the <junit> task. <batchtest> takes a fileset, so the order of
the test files is basically determined by File.listFile(), which returns files
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 run
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 suite
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 source
code for <batchtest> to take a file list. Neither of those paths smells like
a pleasant solution, though.
Any hint would be appreciated.
--J.X.