Maven Junit test integration broken in Netbeans 7.2?
Published Sun, 7 Oct 2012
I was having issues after upgrading to Netbeans 7.2 with it not running single JUnit tests (Ctrl+F6 shortcut) in a particular Maven based project. However it would work with other Maven projects. I figured it was a bug in Netbeans.
It turns out that Netbeans 7.2 changed the way single executions of JUnit tests run, so that now they are run by Maven (previously Netbeans had an internal runner).
Maven uses the Surefire plugin (generally) to run JUnit tests, and as it turns out there is a bug in Surefire plugin version 2.12 which broke the running of single JUnit tests.
And when I checked, sure enough the project that wasn't working was using Surefire plugin 2.12. Changing it to use 2.12.1 fixed the issues.
Sorry Netbeans, it wasn't your fault after all! :)
Hope this helps someone else with the same issue!
About the Author
Richard Nichols is an Australian software engineer with a passion for making things.
You might also enjoy reading -
- NetBeans 6.7 Broke My Parameterized Tests
- Dealing With Static Imports in Netbeans IDE
- visural-wicket 0.6 released - lots of new components!
- 5 Reasons Why NetBeans Rocks
- markdown-doclet Updated to v2