Importing a JUnit or Java Test Class

Modify your Java profile settings accordingly before importing JUnit 4.x module tests.
  1. Click Model Script on the workflow bar. The Workflow - Model Script dialog box appears.
  2. 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.
  3. 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.
  4. 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.
  5. In the Methods area, select the methods that you want to call.
  6. To filter the methods that are shown in the Methods area, perform the following steps:
    1. Click the Advanced Settings button (the funnel icon above the Methods area).
    2. Once you have customized filter settings, click OK to update the Methods area.
  7. To change general Java settings including the Java version, Java home directory, or JVM DLL, click the Active Profile Settings link. The Profile Settings dialog opens to the Java/General page for Java projects (JUnit project type).
    Note: Changes made to these settings (for example Java Classpath) may lead to different results. Selections made in the Class, Constructor, and Methods fields will be updated with the new results.
    Note: If you change the Java version, Java home directory, or JVM DLL, you must restart Silk Performer for the changes to take effect.
  8. Click OK.