Reputation: 2963
In an ant based java project in Netbeans, unit tests take for ever to complete. How do I spead up the unit tests. Eclipse runs the same tests quite fast and same is the case on the command-line.
Upvotes: 0
Views: 304
Reputation: 2963
junit.forkmode=once
. Apply and rerun the tests, you'll notice the tests run significantly faster. For more detail about for attribute please read.
Running junit from ant beware the fork attribute
This may cause Permgen space problem. To fix that add a vm argument in the project properties dialog box.
-Xms128m -Xmx1536m -XX:MaxPermSize=512m
Here are the results for a project with 11,751 unit tests.
Test run without the junit.forkmode
BUILD SUCCESSFUL
Total time: 40 minutes 17 seconds
Test run with junit.forkmode=once
BUILD SUCCESSFUL
Total time: 4 minutes 31 seconds
Upvotes: 3
Reputation: 407
Not specific to ant, rather than a general suggestion:
Upvotes: 0