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 supported.
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 supported.
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:
- In the Performance Test perspective, click , and then click Next.
- Click Browse to select a BPEL file
from the workspace, and click Next.
- 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.
- In the Flow section, select how
any concurrent sequences that are found in the flow will be converted
into paths.
- In the Switch section, select
whether to test otherwise activities from the flow.
- In the Throw section, select
how throw activities from the flow are converted into
paths.
- In the Invoke section, select
whether to test inline catches inside invoke activities
from the flow.
- 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.
- Click Recount paths to update the
number of paths to test, and click Next. One test is generated for each path.
- 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.
- In the Operations list, expand
a test and select a WSDL operation that requires binding.
- In the Binding ports list, select
the port that you want to use to test the selected WSDL operation.
- Repeat steps a and b for each WSDL operation that requires
binding.
- Click Next.
- 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.