Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create more configurations for each additional VM you want to attach to, increasing the port number by 1 for each VM.

If you wish to always enable debugging whenever you run a test, you may also modify the JUnit Template and add the above property. That way IntelliJ will always add it to every JUnit test configuration avoiding the need for repeated setup.

If debugging needs to happen very early in the JVM  startup, it may be necessary to suspend the JVM before the debugger attaches. Setting the following property allows a particular DUnit VM to be suspended - in this example VM 0:

Code Block
-Ddunit.debug.suspendVM=0


To To debug, debug your test normally (I normally put a breakpoint in a @Before method or at the beginning of the test if I want to pause the other VMs), and then select "DUnit VM 0" from the test dropdown (the same one in the first picture, where you chose "Edit Configurations"). Then hit the debug symbol, and as long as the VM has started, you should be connected! Breakpoints will work normally and you can switch between tabs to debug all your VMs!

...