Expressions

Expressions provide test data tables with a powerful way to logically link data or to express validation criteria that would normally be difficult with just literal values.

Any syntactically valid expression that can appear on the right side of an assignment statement can be entered as an expression in a test data table. Thus, all of the following are considered to be valid expressions: primitive values, strings (enclosed in double quotes), variable references, and constructor and method calls.

Expressions can also include variables, constants, and logical operators. Consequently, you can enter any of the following into a table cell:

The following screen capture shows examples of primitives (int 500 and boolean true), strings ("USD"), and variable references (objMoney.amount(), objMoney.currency(), and objMoney1).

Example: test data table with primitives, strings, and variable refs

The following screen capture shows an example of a constructor entered directly into a table cell:

Example: test data table with constructor entered into table cell
Related concepts
Test data tables
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.