How Do I: Generate a JWS File to Test a Java Control?

When you're developing a Java control, you can quickly generate a JWS (web service) file with which to test the control. The generated JWS includes methods that are designed to call methods of your control. The generated file is also conversational so that it can support your control's interface even if it is asynchronous.

While the generated file is obviously not a substitute for actual testing, it does provide an easy to find out if your code works as you expect.

To Generate a Test JWS File

  1. In the Application window, locate the JCS file for your Java control.
  2. Right-click the JCS file, then click Generate Test JWS File.

    WebLogic Workshop will open the newly generated JWS file in Design View. The generated file will include methods that call your control's methods. Where your control's methods have return values, those values will be returned by the test file's methods.

    In many cases, the template you created can be run as generated. However, in some cases you may need to make a few changes before using it to test.

  1. Run the test JWS file.
  2. In Test View, click startTestDrive to begin testing.

This starts the web service's conversation.

  1. After Test View refreshes, click the Continue this conversation link in Test View for access to test forms and buttons through which you can test each of your control's methods.
  2. After Test View refreshes, use the test form provided to test your control's methods. After each test, click Continue this conversation to test another method.
  3. When you are finished testing, click finishTestDrive to finish testing.

Samples

None.

Related Topics

None.