Service Test Builder

 

In this topic ...

How Do I...

Specifying Inputs

Objects this Builder Creates

Related Topics ...

Overview: Working with Data Services

This Builder generates the code necessary to execute and display the results of either a public service created by the Service Definition Builder, or a local service produced by an integration Builder (SQL Call, SAP Function, etc.).

This Builder can generate an "index" page that allows you to choose a service operation to run. If the operation you select accepts inputs, an input page will also be generated and displayed to collect input values. When the operation is complete, a result page will be displayed.

If a service operation has inputs which need to be set to specific values, we can use the "Specify Default Inputs" feature to provide values for these inputs in the Builder call. These input values will be used as the default value in the generated input page.

This Builder also generates one no-argument method per service operation. We can use these "headless" methods to test the service without UI. If these methods are present, they will also be used by the Service Stub Builder to create sample data. If "Specify Default Inputs" was chosen, these no-arg test methods will pass these values to the corresponding operations; otherwise, empty input values will be passed, which may or may not work, depending on the requirements of the operation in question.

 

How Do I...

 

Test a service provider?

 

More How do I... Topics

 

Specifying Inputs

This Builder takes the inputs described in the table below. For help on inputs common to many or all Builders such as those in the Properties input group, see "Using the Builder Call Editor."

Input Name Description
Name Enter a name for this Builder call. The Designer displays this name in the Builder Call List.

This entry is used as the local name of service. If this input is blank or if "Add All Target Methods" is enabled, the target method name will be used.

Service Select the name of the data service you want to test
Generate Main Enable to generate a "main" action that will display the "index page" listing the service operations covered by this Builder call.

Disable to use another means to display the test index page. The name of this page is: builder_call_nameIndexPage.

If this Builder call generates a "main" action, make sure there is no other "main" action in the model.

Specify Default Inputs Enable this check box if you want to specify default values for some or all of the operation input parameters.
Overridden Inputs This input is available when the Specify Default Inputs above is enabled.

We can provide default values for operation inputs here. These values will be displayed as defaults in the generated input form, and will be passed to the no-argument test method.

  • Operation - Select the operation for which you want to provide default inputs

  • Input Name - Specify the name of the input element

  • Input Value -Specify the value to use by default in the generated input form, and when running the no-arg test method
Include Documentation Enable this check box to automatically invoke the Service Documentation Builder. Relevant documentation about the service will be displayed on the index page.

 

Objects Created by the this Builder

A variety of WebApp artifacts are created by this Builder. These artifacts include the following LJOs, variables, methods and Data Services:

 

Pages

  • builder_call_nameIndexPage -- Test index page.

  • builder_call_nameInputPage -- Test input page

  • builder_call_nameResultPage -- Test result page

 

Methods

  • <builder_call_namemain> -- Causes test pages to be displayed

  • <builder_call_operationName> --Headless method is generated for each service operation to facilitate direct testing