Behzad Momahed Heravi
Behzad Momahed Heravi

Reputation: 1403

How to debug multiple JUnit test suites in Netbeans?

I use Netbeans 7.0.1 (and JUnit 4) and have a java project with several test suites in different packages. I can run all tests by Alt+F6 or right-click on project and choose "Test". Also, I can debug each test file separately by Ctrl+Shift+F6 or right-click on project and choose "Debug Test File". But apparently it is not possible to debug the test files all together at once. Ctrl+Shift+F6 does not work if the project or multiple test files are selected and if I right-click on project there is no option to debug test files.

In Eclipse, however there is such option easily by right-click on project and "Debug As" -> "JUnit Test"

Would appreciate any help.

Upvotes: 7

Views: 4225

Answers (2)

Justin R
Justin R

Reputation: 31

To debug/test the entire project I

  1. right clicked on the project
  2. chose properties
  3. chose actions
  4. updated test project with these properties:

test=${packageClassName}
forkMode=once
maven.surefire.debug=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}
jpda.listen=true

Upvotes: 3

UltraMaster
UltraMaster

Reputation: 1134

I am using netbeans 7.2 and it have the option "Debug tests files" in context menu. But you have to select all test files which you want to run (CTRL + left click) and then right click and select this option. It was good enough for me, bud i didn´t figure out how to debug all tests.

Upvotes: 8

Related Questions