In a test data table, you can select the expected exception from
a list of exceptions that are known to the test project.
To select an expected exception:
- Right-click in the Expected column of the exception you want to
define.
- Click Browse to display a list containing
all of the exceptions known by the current project.
- Type the name of the exception or enter a partial name using wildcards
such as a question mark (?) and asterisk (*).
- Select the desired exception from the list of matching exceptions.
- If the selected exception exists in more than one package, select
the preferred package from the Qualifier list.
- Click OK.
The selected exception appears in the table cell.
Note: In stub data
tables, you need to specify a behavior that will throw an exception by writing
the actual expression, not just the type of the expression, for example "new
java.lang.RuntimeException("Outchhhh").