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.
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
Not specific to ant, rather than a general suggestion:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.