Show TOC Start of Content Area

Process documentation Testing Components  Locate the document in its SAP Library structure

You can use the Enterprise Portal Unit Test LaunchPad in the NetWeaver Developer Studio to test your component from within the development environment. The LaunchPad runs your component and displays the output from any test code in the component.

In order to test your component in the LaunchPad, the following is required:

·        The component must implement the com.sapportals.portal.prt.test.ITestable interface.

·        The component must contain one or more test methods. A test method is of the form testXXX, where XXX is any string, with the following parameters:

¡        IPortalComponentRequest: The standard portal request object.

¡        IPortalComponentTestResponse: A special test response object that includes methods for testing conditions and logging the results.

The following is an example of a test method.

public void testMyTest(IPortalComponentRequest request,
              IPortalComponentTestResponse
response) {

 

    INode node = request.getNode();

    NodeMode nodeMode = node.getNodeMode();

    response.assert(nodeMode != INode.EDIT, "EDIT Mode not set!", "");

}

For more information on using the LaunchPad and creating test code, see Enterprise Portal Unit Test Studio Perspective.

 

End of Content Area