Rubrique précédente: Native Test StepsRubrique suivante: Deploy a Native Test Step


Create a Native Test Step

This procedure describes creating a native test step.

Follow these steps:

  1. Create a Java class that extends com.itko.lisa.test.TestNode.

    This class implements the runtime logic of the test step. See the Javadoc for TestNode and the sample code that is provided for FTPTestNode in the samples that accompany this document. The following calls are important for the construction of a test step:

    public void initialize( TestCase test, Element node ) throws TestDefException 
    

    LISA invokes this call for you to read the parameters you require for the operation from the test case XML DOM. As the test case is constructed, it is passed with the DOM Element of the step that represents this node in the test case XML.

    public void execute( TestExec ts ) throws TestRunException 
    

    This is called when your test step logic is invoked. The LISA workflow and state engines manage most of the control flow and data requirements for you. You can access the TestExec given as a parameter to perform various tasks. See the Javadoc on TestExec and the description of this class in Integrating Components.

  2. Create a Java class that extends com.itko.lisa.editor.TestNodeInfo.

    To create and edit your node, provide a controller and viewer in the MVC pattern. The TestNodeInfo class is the base class for all test steps that are developed for LISA. The authoring framework executes this class to interact with your test step data and logic. See the Javadoc for TestNodeInfo and review the example class that is provided, named FTPTestNodeController.

  3. Create a Java class that extends com.itko.lisa.editor.CustomEditor.

    This class provides LISA with the actual user interface for viewing and editing your node data. The authoring framework constructs and calls this class to display your parameters, verify their validity, and save your changes back into the TestNodeInfo extension. This CustomEditor extends JPanel in the Java Swing API. See the Javadoc for CustomEditor and view the sample code for help writing your own editors.

  4. Perform the following method overrides if you want to control how the default name of the step is generated.