Method-level testing exercises the different conditions
defined in the method code in isolation from other methods, allowing you to
test each individual method independently. The focus is generally to ensure
that the method correctly processes all of its possible inputs.
Before you can create a Web service component test, you must have
access to the Web service definition file (WSDL).
To create a component test for a HTTP-based Web service:
- Select and
click Next.
This starts the Create
Web Service Component Test wizard.
- On the first wizard page, take one of the following actions:
- Select the test project that will contain the test and click Next.
- Click New to create a new test project.
- On the next page, you select the Web service under test:
- Locate the WSDL definition file for the Web service under test. You can use Browse for a WSDL from your workspace,
or use Import to import the file from the filesystem.
- Select one or more port types to test.
- In the Web service runtime Java proxy generation list,
select the runtime environment (IBM® WebSphere® or Apache Axis) that you
want to use to generate the Java™ proxy for the test.
Note: You
cannot use multiple runtime environments within a single project. If a Web
service component test or stub already exists in the current test project,
you can use only the runtime environment that was previously used in this
test project. To create a test using a different runtime environment, you
must create a new test project.
- Click Next.
- On the "Select a test pattern" page, select the Method-level
testing pattern and click Next.
- On the "Select the methods to be tested" page, select the individual
methods you want to test and click Finish.
The end result is a test behavior script and a test suite with one
test case each selected method.
You can now edit the test behavior script generated from the WSDL
file. Use the test data table to specify input values (server requests) and
expected return values. You can also add, remove, and edit initialization
points and validation actions for the test. Before running the test, make
sure that the Web service under test is running on an application server.