Running single maven test in IntelliJ
Submitted by Ben_Charlton on Sat, 06/12/2014 - 12:39
Tim,
I am gradually retraining myself into IntelliJ I am particularly loving the way it can take 7 modules on different VCS's and synchronize branching and commits.
However its lack of native maven integration is a pain. Netbeans does that so much better, but I am pushing through.
Using Maven Helper and Maven Test results simplified things, but aside from manually typing out a test on the commandline to run a single maven test is there any context where you can right click a test to run it and its dependencies...just to test that test alone?
At the moment I am forced to run the whole test set to get to the 1 failure I am working on.
Ben
Re: Running single maven test in IntelliJ
To debug a single test case, right click anywhere on the test (e.g testA()) in the editor and click Debug "testA()".
You can run all tests in a class (e.g. class TestA) by right clicking on the class name and clicking Debug 'TestA'. Same applies in the Project window.
In the Project window, you can also run all of the tests for a package by right clicking on it.
-Tim