FreeAgent sign-up

Optimising JUnit performance in Ant

Ever been in the situation where your unit tests are running really slowly with Ant from the command line but run like lightening in your IDE? Usually tests which are persisting to a database?

I’ve recently had this problem and I managed to solve it by not forking the batchtest task, and instead forking the junit target and setting the forkmode attribute to once, like so:

<junit printsummary="true" fork="yes" forkmode="once">
<batchtest todir="${tmp}">
</batchtest>
</junit>

Posted by Olly on June 20, 2006 at 8:46 am in ant, java, software
| Permalink

Comments are closed.