ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: run junit tests in a certain order
Date Wed, 26 Nov 2003 09:12:29 GMT
On Tue, 25 Nov 2003, J. Xue <ant@manifoldronin.com> wrote:

> I'm sure I'm not the first one having this problem but can't find
> anything on google.

Well, then you didn't use the right keywords 8-)

Generally, JUnit advocates are going to tell you that you are trying
to do the wrong thing in the first place as unit tests are supposed to
be independent of each other.

Now to your problem:

An alternative to your approach is to explicitly use <test> elements
for the tests that need a certain order and exclude them from the
<batchtest> that contains the rest.

> 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!

With Ant 1.6beta, all necessary information is inside the XML reports,
but I don't think that <junitreport> uses it right now (an attribute
has been added to the test elements).  If you use the beta and modify
the XSLs to use the new attribute, your reports should work as well.

Stefan

-- 
http://stefanbodewig.blogger.de/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message