Running a Unit Test

See Also 

Once you have created a test or test suite, you can use the Run Test command to initiate execution of the test. Run Test commands are available on source nodes only. After you run a test, you can choose to rerun individual test methods executed during the test and displayed in the Test Results window.

To run tests for an entire project:

  1. Select any node or file in the project you want to test in the Projects or Files window.
  2. From the main menu, choose Run > Test Project (project_name) (Alt-F6).

    The IDE executes all of the project's tests.

To run a test for a single class:

  1. Select the node of the class for which you want to run a test in the Projects or Files window.
  2. From the main menu, choose Run > Test File (Ctrl-F6).

To run a single test method:

  1. Run the test class or suite containing the test method.
  2. In the Test Results window, right-click the test method and choose Run Again.

Working with Unit Test Output

When you run a test, the IDE shows the test results in two panes in the Test Results window:

See Also
Creating a Unit Test
About Running Java Applications

Legal Notices