Inserting validation actions

Validation actions verify whether the actual value of a variable at execution time corresponds to the expected value of that variable.

Validation actions can be entered directly into the test behavior source code or defined from the test data table (TDT).

To insert a validation action:

  1. Open the test behavior source code in the Java™ editor. (To find the source code, open the Package Explorer view, expand the test project you are storing the test in, and expand the Behavior folder.)
  2. Position the cursor at the location in the code where you want to add the validation action. (If you choose to use an existing variable for the validation action, the cursor must be positioned after that variable first appears in the code.)
  3. Right-click and click Component Test > Insert validation action, and then do one of the following:
    • To use an existing variable for the validation action, click Select a variable for a Validation Action, select a variable from the list, and click OK.
    • Or create a new variable, click Create a new variable for a Validation Action, specify a variable name and type, and click OK.

    The validation action is added to the test behavior code, and a new row is added to the test data table. For example, if the variable is named amount, the following code is added:

    ComponentTest.check(amount);

  4. In the test data table, insert a value for the variable.
Related concepts
Validation actions
Component testing and the Java editor
Stub behavior
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.