Editing Stubs
Editing a stub means specifying the simulation data to be used when the stub target is invoked during the execution of a test case. In general, a stub has these two common tabs:
- Parameters (previously Simulation Data) for entering the values to be returned by the stub.
- Properties (previously Information) to change alias name and description and obtain information about the interface of a test case.
Parameters
The Parameters tab allows you to enter the values to be returned when the stub target is invoked during the execution of a test case that includes the stub.
The name listed in the Description column for the stub was derived from the interface name for which it was created.
The Key column only appears for keyed VSAM RRDS stubs and displays the relative record number (RRDS) for the selected record. The records will be automatically sorted in key order when the Stub definition is saved. You can also explicitly sort the records by using the Key Sort Button. If you choose not to include a key, the records will be read sequentially.
To update a key value, right click in the Description column and select Update Key. In the dialog specify the new Key value and click OK.
Entering stub data values is basically identical with entering data for a test case. However, opposite to the attributes in test cases, the attributes used for entering simulation data values for stubs are the output (with usage out or in/out) attributes of an interface.
When a stub is active, the input data it receives are not evaluated in any way. Instead, just the given set of simulation data is returned to the caller.
If you modify the simulation data of a stub, the change will affect all test cases that include this stub. Therefore, subsequent execution of test scenarios using the stub will be performed with the new simulation data.
To add Simulation Data, right click in the Description column and select Add Simulation Data..., or click on the
icon above the Description column, specify the new name and click OK. Then just add new values as needed.
When multiple names are listed, the sequence number for each name indicates the sequence order of the simulation data. Use drag and drop or Move Up and Move Down to change the sequence order. Hover over the name to view the initial sequence number of the entry.
Other right-click options in the Description column are:
- Duplicate Simulation Data...
- Rename
- Delete
- Move Up
- Move Down
- Update Key
Quick Filter
The Quick Filter field under the tabs allows you to specify any alphanumeric string to display only the records that contain the string. Use the Clear Filter button to reset the filter.
Structure
The Structure column displays a list of the structures used as input in the test case, as specified in the interface definition, including their substructures and attributes. The Parameters tab includes a link to the current interface definition, which will be updated whenever you save a change (edit) to the structure. Please refer to General Editor Behavior for a detailed description of all options provided to navigate in this list.
If the attribute is contained in an array, by default, the first array element will be used for the input value. If you need an input value for another array element, right-click on the array, then select Add array element from the context menu. A new array element will be added to the array which you can now enter input values for. Alternatively, you can right-click on an array element and select Duplicate array element from the context menu to create a copy of the array element and add it to the array. In order to remove an array element, right-click on the array element, then select Remove array element from the context menu.
Other right-click options for the Structure elements include:
- Redefine element - displays the Redefine dialog (see Redefine-element).
- Replace element - displays the Replace dialog (see Replace-element).
- Delete element - deletes the element from the structure.
- Insert new field after element - displays the Insert dialog (see Insert-element).
- Redefine element with selection criteria (see Redefine-element-using-selection-criteria).
- Revert to original interface - restores the element as defined in the original interface, not to any previously applied changes to the element.
- Disable assertion for - turns off the assertion function for the selected element for all records or only the selected record (only available sub-program entry assertions).
- Enable assertion for - turns on the assertion function for the selected element for all records or only the selected record (only available sub-program entry assertions).
- Data truncation warning - New field is n bytes shorter than previous field. Choose how data will be truncated:
- Trailing data
- Leading data
- Do not change data
- Pad data - New field is n bytes longer than previous field. Choose justification of pad data:
- Trailing data
- Leading data
- Do not change data
Location
The Location column describes the position values for the specific field.
Comparison
When the stub type is WRITE, for example, QSAM Write, the Simulation Data includes three additional columns, Comparison, Label, and Failure Message. They allow you to specify write assertions (check conditions) for the stub. These check conditions can be created for WRITE operations and will compare the value of the stub to the intercepted write operation in the program.
The Comparison column allows you to specify the comparison operator used for the check condition. The following operators are available:
Comparison Operators
Operator | Description |
---|---|
noassert | Assertion (check condition) not active – will not be used |
= | Attribute must be equal to the given value |
<> | Attribute must be not equal to the given value |
> | Attribute must be greater than the given value |
>= | Attribute must be greater than or equal to the given value |
< | Attribute must be less than the given value |
<= | Attribute must be less than or equal to the given value |
same | Attribute must be unchanged (output value equal to input value) |
Expected Value
The Expected Value column allows you to enter the value to be used in the assertion or check condition.
Values for text attributes can alternatively be entered in hex format, for example as x'61a5'. The hex value must be given in the target platform encoding because for hex values, no character conversion is performed.
Label
The Label column allows you to enter a descriptive name for the check condition which is displayed in the Result Report. When creating a check condition, it defaults to "Check for attribute name", but you can change it to a more descriptive text.
Failure Message
The Failure Message column allows you to enter a descriptive name for a check condition failure which is displayed when the check condition fails (does not evaluate as expected). When creating a check condition, it defaults to "Check for attribute name failed", but you can change it to a more descriptive text.
Properties
The Properties tab displays the Stub Name, Alias name, Description, File DD Name, Type, and Disposition information and allows you to change the Alias name, Description, File DD Name, and Disposition of the stub. To change the Disposition, select one of the available choices, SHR, MOD, OLD, or NEW, from the list.
To quickly open the interface, click on the interface name listed under Current Simulation Record Interface.