Creating and updating JUnit test suites

To create a new test suite:

  1. Select a package in which you have tests for which you want to create a test suite.
  2. Open the new wizard dialog by doing one of the following:
  3. Select Java > Junit from the left pane and TestSuite from the right pane
  4. Press Next
  5. TestSuite creation wizard

  6. In the Source folder field, enter the name of the source folder in which the test suite will be created.
  7. In the Package field, enter the name of the package (empty name denotes the default package) in which the test suite will be created.
  8. In the Test suite field, enter the name of the test suite class.
  9. In the presented list of classes, select the test classes for which you want to create the test suite.
  10. Press Finish.

You can add new test classes (or remove some) to the created suite:

Note: the wizard puts 2 special markers (//$JUnit-BEGIN$ and //$JUnit-END$) into the created Test suite class, which allows the wizard to update existing test suite classes. It is recommended not to edit code that lies between the markers.

Related tasks

Using JUnit

Related reference

JUnit preference page

Copyright IBM Corporation 2000, 2002. All Rights Reserved.