To set up a
Java Explorer test using the
Load File Wizard:
-
Click
Start Here on the workflow bar.
The
Load File Wizard dialog box opens.
-
Click the option button that corresponds to the class type that you want to test.
- Web Services
- Enterprise JavaBeans
- RMI
- Java Archive
- Java Class
-
To test a Web service, you must provide a Web Services Description Language (WSDL) document. Click the
Web Services option button and specify a path or URL to the WSDL document using the browse
(...) button.
注: To test
Enterprise JavaBeans, click the corresponding option button and then specify the EJB-specific connection settings. To test other class types,
click the appropriate option button and then specify the path to a Java archive or class file.
-
Click
Next.
The WSDL file now loads and finds out what is available on the Web service. A WSDL file is an XML description of the functionality
that is offered by the Web Service.
注: The sample Web service offers a minimum of functionality-it simply echoes back some values.
-
Select the Web service class you wish to test from the
Class list box. Normally there will be only one class, but it is possible that the loaded WSDL will define multiple Web services.
-
Use the
URL (Endpoint) text box to change the endpoint of the service.
The default endpoint is the one defined in the WSDL document.
-
Optional: To change the Web service proxy and authentication settings for the Web server, click browse
(...) to open the
Connection Settings dialog box.
-
Type the endpoint of the Web service in the
URL text box.
-
If user credentials are required for authentication, type the information in the
Username and
Password text boxes.
-
Click
OK.
-
Click
Next.
The
Method Invocation dialog box opens.
-
Check the check boxes beside the methods that you want to test.
For example
echoFloat and
echoString. Methods are called using the default parameters.
注: The checked
Inherited check box indicates that the member functions of the base classes are visible. You cannot change the state of the check box
manually.
-
To adjust the sequence in which the methods are called, use the up and down arrow buttons. This way, you can move methods
up and down the invocation list. The button between the up and down arrow buttons enables you to invert the selection of methods,
meaning that all unmarked methods become marked, and vice versa.
注: Login and logout methods must be in first and last positions, respectively.
-
Click
Next.
The
Select a test case dialog box opens.
-
Select the test case to which the testing methods should be added. You can select from the following:
- Init Test Case: This is the first test case that is called in test runs. Select this test case if your method calls are related to initialization,
logging in, or start-up.
- Existing Test Case: You can add to an existing test case. Choose the test case from the list box to the right of this selection.
- New Test Case: A new test case is created and the methods are added to the new test case. Using the text box to the right of this selection,
give the new test case a unique name.
- End Test Case: This is the last test case that is called in test runs. Select this test case if your method calls are related to clean-up,
for example logging off.
-
Click
Finish.
注: A message displays if you have selected a method that takes parameters, letting you know that default parameters will be used
for the method, which may result in an exception being thrown. Methods that throw exceptions will be excluded from your test
scenario. If you don’t want to proceed, click
No, then go back, deselect the method in question, and add it later manually with a more meaningful parameter value.
The Web service has been loaded in the class tree list and the selected methods have been called and added to the selected
test case.