Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 905
Behzad Momahed Heravi Avatar asked Jul 03 '12 16:07

Behzad Momahed Heravi


2 Answers

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.

like image 152
UltraMaster Avatar answered Sep 20 '22 21:09

UltraMaster


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

like image 26
Justin R Avatar answered Sep 21 '22 21:09

Justin R