Creating a service test from a BPEL model

You can use Business Process Execution Language (BPEL) resources from your workspace to automatically generate a set of service tests that corresponds to the paths that are run in a synchronous BPEL model.

Before you begin

Tests are stored in test projects. If your workspace does not contain a test project, the test creation wizard creates one, enabling you to change its name. To store a test in a specific project, verify that the project exists before you record the test.

If you are using Secure Sockets Layer (SSL) authentication, ensure that you have any required key files in your workspace.

If you are using Java Message Service (JMS), ensure that you have configured the environment with the correct libraries and configuration files. Ensure that the WSDL files use the correct syntax for the test environment.

If you are using SOAP security, ensure that you have configured the environment with the correct libraries and configuration files.

BPEL models must be synchronous. Asynchronous BPEL models are not checkmark_perf.jpg.

Ensure that the BPEL models refer to the WSDL files in a valid import statement, for example:
<bpws:import importType="http://www.w3.org/2001/XMLSchema" location="foo.wsdl" namespace="http://foo"/> 
Relative file paths, such as: "../../foo.wsdl" are not checkmark_perf.jpg.
Ensure that you have one or more valid Web Services Description Language (WSDL) files and the associated BPEL model in your workspace. Only the calls to services with a valid web service binding are taken into account. For example, if the BPEL model was produced in IBM® Websphere Integration Developer, then services must be exported with the following web service bindings:
<bpws:invoke name="myOperation" operation="myOperation" partnerLink="IServicePartner" portType="ns3:IService" wpc:displayName="myOperation" wpc:id="20">

Only BPEL invoke activities are considered for generating tests. Any BPEL receive and reply activities are ignored.

Websphere Integration Developer does not generate the required soapAction attributes for the soap operations in the WSDL files. Please edit the generated WSDL files, as follows for every operation: <soap:operation soapAction=""/>.

Procedure

To create a service test from a BPEL model:
  1. In the Performance Test perspective, click File > New > Other > Test > Test Assets > BPEL to Web service test, and then click Next.
  2. Click Browse to select a BPEL file from the workspace, and click Next.
  3. On the Web service test generation page, change the number of paths by specifying how activities and sequences from the flow of the BPEL model are processed. Each path generates one test.
    1. In the Flow section, select how any concurrent sequences that are found in the flow will be converted into paths.
    2. In the Switch section, select whether to test otherwise activities from the flow.
    3. In the Throw section, select how throw activities from the flow are converted into paths.
    4. In the Invoke section, select whether to test inline catches inside invoke activities from the flow.
    5. Select Enable data correlation in generated tests to automatically create references in the generated test elements by propagating variables to the parameters of the web service call and message return elements.
  4. Click Recount paths to update the number of paths to test, and click Next.
    One test is generated for each path.
  5. For WSDL operations that are bound to multiple ports, you must select one port that is to be used for the test.

    Under each test that will be generated, the Operations list displays the WSDL operations that are bound to multiple ports.

    If no WSDL operations are displayed under the tests, this means that all operations are bound to a single port. In this case, skip step 6.

    1. In the Operations list, expand a test and select a WSDL operation that requires binding.
    2. In the Binding ports list, select the port that you want to use to test the selected WSDL operation.
    3. Repeat steps a and b for each WSDL operation that requires binding.
  6. Click Next.
  7. Select a location and a name for the new folder where the tests generated from the BPEL model are created, and click Finish.

Results

A new folder is created in the Test Navigator containing the generated service tests. These tests are generated with default message content and must be edited with valid input values.