Stubs in the Web Client

Stubs are created from the component execution page, where either entered input data or result data from an execution can be saved as a stub.

inset_2.jpg

To create a new stub:

  1. Find the XAPGMTST component or another component of your choice and click the Execute button, which will redirect you to the Execute page.

  2. Execute the component.

  3. Click the wrench.gif button and the save buttons are located on the Options panel. Click the Save result as stub button.

  4. Enter a label and description for the stub and optionally choose a category. Click Create new.

inset_3.jpg
  1. Navigate to the Component Repository > Component Stubs menu to see all stubs.

  2. Find and select your newly created stub.

  3. Click the Edit button and try to change a couple of values before clicking Update. You can also create a new stub from an existing stub.

inset_4.jpg

 

We will now use the stub when executing the XAPGMTST or your own program. This will simulate the invocation of the component and the stub data will be returned. You can similarly create stubs of submodules that a component uses. If you add such stubs to a component execution, then the module will not invoke the sub modules but instead it will receive the stub data.

Complete the following steps to use the stub in a component execution.

  1. Navigate to the execution page for XAPGMTST or your own module. Click the wrench00004.gif button to view the Options panel. At the Stubs tab, click the Plus button. It will open a dialog for selecting a stub.

  2. Select the newly created stub.

inset_5.jpg
  1. If one of the sub modules you are mocking is statically bound to the component, then you have to enable the One or more sub modules are static linked.

  2. Execute the module, and you should get the data back equal to what you previously edited.

As usual you can save the input data, which will include information about the stubs. This is also true if you create a test scenario from the data.