Using the SDK

DevTest Solutions allows you to customize many of the application functions. This section describes how to extend DevTest functionality through the Software Development Kit (SDK).
dts91
DevTest Solutions allows you to customize many of the application functions. This section describes how to extend DevTest functionality through the Software Development Kit (SDK).
Examples and API Documentation
The following file contains the examples that are referenced in this guide: examples.zip
The SDK JavaDocs file contains the API documentation. The SDK JavaDocs are available in the
docs
folder of your installation directory.
The Integration API
DevTest
provides an integration Application Programmer Interface (API) that lets you manage test execution within Java-based server-side components. This section details the basic concepts central to the integration API.
Integration API Concepts
DevTest Solutions
provides a powerful framework for testing server-side components. However, if a test fails, the framework provides little information about why the test failed. Although the component under test often calculates information that is of interest to the tester, this information is difficult to retrieve.
The integration API provides several elements for getting information out of server-side components. These elements include:
  • Integrators:
    The application-specific Java classes that coordinate communication with the running test. For example, an EJB Integrator informs an EJB component whether integration is turned on. For more information about integrators, see Integrating Components.
  • TransInfo Class:
    Abbreviation for Transaction Information. The integrated component uses this class to indicate testing events, such as a test failure or success. For more information about using the TransInfo class, see Integrating Components.
  • HasLisaIntegrator Interface:
    Implemented by object types that are returned by methods that are integrated using Java-based integrators. These object types provide the running test with the information it needs about how the test has changed while testing the component. For more information about implementing the HasLisaIntegrator interface, see Constructing a Response Object.
  • Integration Filters:
    Application-specific
    DevTest
    filters that coordinate communication with the integrated component. For example, the Servlet Filter turns on integration support for a servlet component and specifies a node to execute if the servlet returns specific values. For more information about integration filters, see Testing Integrated Components.
  • Integration Assertions:
    Special assertion elements that take advantage of the additional information that integrated server-side components provide. For example, a Check Integrator Response assertion can set the next test step based on the build status reported by the integrated component. For more information about integration assertions, see Testing Integrated Components.
Integration Flow
The integration flow includes the following steps.
  1. The test case developer adds an application-specific integration filter to a test case. When the test is run, the filter turns on integration support for the type of application indicated. For example, the test case developer adds a Servlet Filter to test an integrated servlet.
  2. When the server is invoked, test-enabled server components use the application-specific integrator class and the TransInfo class to establish the communication with the running test case. For example, if a servlet fails in some way, it can call
    TransInfo.setBuildStatus()
    to note the failure to
    DevTest
    . For more information about the TransInfo class, see the JavaDocs in the
    doc
    folder of your installation directory.
  3. The filter automatically processes responses from the system-under-test. The filter logs important information and processes any commands from the tested component.
The Integration Process
To integrate to the
DevTest
integration API:
  1. Make sure
    lisa-int-
    release#
    .jar
    is in your classpath.
    You can find
    lisa-int-
    release#
    .jar
    in the
    LISA_HOME\lib\core
    directory.
  2. Add
    DevTest
    integration to the method.
    For more information about integrating into a server-side component, see Integrate Server-Side Components.
  3. Handle the output from the integrated method.
    For more information about handling integrated output, see Handle Integrated Output.
  4. Use integration filters in the test case that tests the server-side component.
    For more information about integration filters, see Testing Integrated Components.
  5. Use integration assertions in the test case that tests the server-side component.
    For more information about integration Assertions, see Testing Integrated Components.