Debugging a Test Failure

In the case of a test failure you can follow these steps to debug it:

  1. Double click the failure entry from the stack trace to open the corresponding file in the editor.
  2. Set a breakpoint at the beginning of the test method.
  3. Select the test case and execute Run > Debug as > JUnit Test from the menu bar or simply execute the test case from the launch history in the Debug toolbar button drop down menu.
  4. If you have the "keep alive" preference option set and your target VM supports hot code replacement you can fix the code and rerun the test without restarting the full test run.
    Note: to set the preference, open the Launch configuration dialog, select the launch configuration for your test and select the Keep JUnit running after a test run when debugging checkbox .

Related tasks

Using JUnit

Related reference

JUnit preference page


Copyright IBM Corporation 2000, 2002. All Rights Reserved.