Defining a test-generation wizard

The Generate Test wizard contains four sections to guide you in defining a test generator.

The Generate Test wizard contains these sections:

  1. Test generator selection.
  2. Test files selection.
  3. Data correlation options.
  4. Test generator wizard.

The first page is displayed only if more than one test generator is applicable for the input recording session. The second page is displayed only if the user has not already chosen the test file before the recording.

You must declare a wizard for each test generator that you have defined. A test generator that has no declared wizard is not available in the user interface and can be launched only using a test generation configuration file, which is a file with the .testgenconfig extension, or programmatically.

When completed, this wizard produces a test-generation configuration that contains a set of converter and test generator configurations. This configuration is applied by the test generation framework to instantiate the appropriate converters and test generators and to send the packet stream from the recording session to the converters and test generators.

Test-generator wizards can add pages to the Generate Test wizard by specifying an implementation class in the test generator wizard declaration in the plugin.xml file.

To define a test generator wizard:

  • Declare a new test generator wizard in the plugin.xml file by using the com.ibm.rational.test.lt.testgen.ui.testgenWizard extension point.
  • Specify the test generator ID that the wizard configures.
  • Provide a label and icon that represents the type of test to be generated by the test generator.
  • Optionally, provide an implementation class. If you do not provide a class, the wizard has no configuration page. If you provide a class, it must extend the com.ibm.rational.test.lt.testgen.ui.wizards.NewTestGeneratorWizard class.

Consider these facts about NewTestGeneratorWizard implementations:

  • This class extends the JFace class wizard, so it must extend typical methods such as the addPages() method.
  • The class is passed an empty test-generator configuration, typed with the test generator ID selected by the user in step 1.
  • The class is responsible for setting the test generator configuration options, which are available by using the getTestGeneratorConfiguration() method. This method is typically used in the doPerformFinish() method.
  • The wizard can get contextual information by using getContext() method.