2.3.3 Sample 1.3: using Event Handlers

This category has four subcategories. Each subcategory contains a test which reuses a Test Case to execute a calculation in the Simple Adder which will cause an error. After the error, a reset is carried out.

An Event Handler has been specified in the bound_modules_samples Project . The Event Handler has been added to the Test Case , and checks that text in the result field is jackpot.

The four tests are as follows:

Continue
The Event Handler in this test has the reentry property continue. When the error occurs, the Event Handler is activated. Once the check has been carried out, the test continues, and the reset is performed.
Exit
The Event Handler in this test has the reentry property exit. When the error occurs, the Event Handler is activated. Once the check has been carried out, the test finishes. The reset is not performed.
Pause
The Event Handler in this test has the reentry property pause. When the error occurs, the Event Handler is activated. Once the check has been carried out, the test pauses. By un-pausing the Test Suite in the client, the test continues.
Retry
The Event Handler in this test is different to the Event Handler in the other tests. It contains the same steps as the test itself, but the parameter references have been switched. This essentially changes the order in which the numbers are entered into the Simple Adder. The Event Handler has the reentry property retry. When the error occurs, the Event Handler is activated. The calculation is redone with the switched values. The failed Test Step (i.e. the original check) is retried, and there is no error. The test is marked as successful.



Copyright BREDEX GmbH 2012. Made available under the Eclipse Public License v1.0.