Importing a JUnit Test Suite

Modify your Java profile settings accordingly before importing JUnit 4.x module tests.

  1. Select Project > Import Unit Test > JUnit Test Class . The Import Unit Test - JUnit Test Class dialog opens.
  2. Cick the Advanced Settings button (the funnel icon above the Methods area). The Advanced Settings dialog opens.
  3. Perform the following steps:
    1. Uncheck the Unit Test Functions Only check box.
    2. Check the Declared Functions Only check box.
    3. Uncheck the Member Functions Only check box.
    4. Click OK.
  4. In the File field, specify the archive that is to be tested. The archive is automatically added to the profile classpath. The available classes are then retrieved and displayed, sorted alphabetically in the Class field.
  5. From the Class list, select one of the available classes for testing.
    When you do not specify a specific archive for testing, the wizard enables you to specify a class that is available in the profile classpath. Type the fully qualified class name into the Class field, for example java.lang.String. The available constructors and methods are automatically retrieved and displayed.
  6. From the Constructor list, select the appropriate constructor for instantiating the imported class. If a constructor is not selected (entry <No Instance Required – Only Static Calls>), only static methods will be displayed in the method list.
  7. In the Methods area, select the suite() method, then click OK.