About Customizing the Example Import Formatter

If you have imported date from Microsoft Excel, Microsoft Word, or When you customize the example import formatter, you must determine the modifications to make. This topic reviews the modifications you can make and describes the classes, interfaces, and methods to use to implement them in the Java code.

Creating a customized import formatter requires knowledge of Java programming.

You can modify the

Source type

The source type specifies the format of source data to be transformed into a Manual Tester test script. The user selects the source type information on the first page of the import wizard. Select the source type for your customized import formatter based on the existing data that you want to transform into Manual Tester scripts.

If your source data is in a format other than Microsoft Excel, Microsoft Word, or TestManager ManualTest, you must create a new source type. If your source data is in one of these formats you may be able to use the on of the source types included in Manual Tester, or you may have to create a new source type. To determine whether or not you need to create a new source type, build the example import formatter with one of the existing source types, for example, Microsoft Excel. Import some source data.

If the resulting test script does not meet your needs, for example, it does not include all of the data you wanted it import, you must create a new source type in addition to modifying the configuration page and finish action.

If the resulting test script meets our needs, you do nto have to create a new source type. You can use the existing source type and modify only the configuration page and finish action.
Note: If you use an existing source type, you must remove the example source type from the example import formatter.

Configuration page

The configuration page is the second page of the import wizard. The import formatter's configuration page has input fields that gather the data that the user provides when importing files. The finish action class transforms the import data into a Manual Tester test script. You can define the data that is collected and the GUI control widgets that are displayed by modifying the configuration page code in the example import formatter.
Note: The Eclipse web site (http://www.eclipse.org) has additional information on SWT widgets.

The configuration page must implement the IMTAImportConfigPage interface, which contains methods that add the Configuration page into the import wizard.

The configuration page is specified in the plugin.xml file, which ties it to the import formatter.

ExampleImportConfigPage in the example import formatter is a working example of a configuration page. In this example, the creation and control of GUI control widgets are in a separate class called ExampleConfigPage for clarity. You are not required to split the configuration page functionality into separate classes.

Interface and Methods Description
IMTAImportConfigPage interface  
  • setWizardPage(IWizardPage)
Specifies the configuration page for the input wizard to work with. The configuration page caches the IWizardPage value so that it can notify the wizard when all values on the configuration page are valid.
  • createConfigPageControls(Composite)
Creates the GUI control widgets that are displayed on the configuration page.
  • getConfigSettings()
Called after the Finish button is pressed. Returns the information that is passed to the finish action initialize() method.

Finish action

The finish action class transforms the imported data into a Manual Tester test script. The finish action class is called when the Finish button is pressed. It takes the information in the Configuration page as input, and processes the import data, creating one RMT statement at a time.

The import finish action must implement the IMTAImportSource interface, which specifies methods that initialize, request statements, and clean up the import operation.

The finish action is specified in the plugin.xml file, which ties it to the import formatter.

Table 1. Configuration page interfaces
Interface and Methods Description
IMTAImportSource interface  
  • initialize(IMATImportSourceConfigSettings)
First method called in the finish action. Passes the information set in the configuration page get(ConfigSettings() to the finish action.
  • destroy()
Last method called in the finish action. Frees up allocated resources.
  • getCurrentDocumentPath()
Returns the file is being imported.
  • getStatements()
Returns a Java iterator, which returns one top-level statement at a time. Each Iterator.next() call returns an IMATImportNode.
  • getLastError()
Returns the last error that occurred so that it can be reported to the user.
IMTAImportNode interface Defines the manual test statement, which is returned by the getStatements() method.
  • getType()
Returns the statement type, which can be one of the following:
  • IMTAImportNode.TYPE_STEP - step
  • IMTAImportNode.TYPE_BLOCK - group
  • IMTAImportNode.TYPE_VP - verification point
  • IMTAImportNode.TYPE_TESTCASE - reporting point
  • getName()
Returns the statement name, which is displayed in the Outline view. If this method returns null, the Outline view displays the first 32 characters of the description.
  • getDescription()
Returns the statement description, which is displayed in the Editor view. This method may return null.
  • getAttachments()
Returns an array of strings, each of which is the full path file name of an attachment.
  • getChildren()
If the statement type is block and the block has children, returns a Java iterator; otherwise returns null. Returns one statement at a time, that is, each Iterator.next() call returns an IMTAImportNode.
  • destroy()
Called after all information has been extracted. Frees up allocated resources.

Parent topic: Creating an Import Formatter

Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.