Inserting initialization points

Typically, you use initialization points to initialize a variable that will be referenced by multiple cells in the test data table or to define a set of objects that have defining attributes.

Initialization points can be inserted directly in the test behavior source code and can be data-driven from the test data table (TDT). Initialization points can also be inserted into the code from the test data table.

To insert an initialization point:

  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 initialization point. (If you choose to use an existing variable for the initialization point, the cursor must be positioned after that variable first appears in the code.)
  3. Right-click and click Component Test > Insert initialization point and then do one of the following:
    • To use an existing variable for the initialization point, click Select a variable for an Initialization Point, select a variable from the list, and click OK.
    • Or to create a new variable, click Create a new variable for an Initialization Point , specify a variable name and type, and click OK.

    The initialization point 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.set(amount);

  4. In the test data table, insert a value for the variable.

Related concepts
Initialization points
Component testing and the Java editor
Stub behavior

Related tasks
Testing Java classes

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.