Test phases
A new, empty test always consists of three basic phases: Initialize, Test Steps and Tear-down.
The essential usage of the three steps is as follows:
- The Initialize phase must be restricted to executing
commands that start or configure plug-ins, servers, or target resources.
This phase can be used for test preparation (for example, populating
environment variables), but if these variables are overwritten in
the test steps, they are not restored to their original values. Note: Test data set values are not accessible from the Initialize phase.
- The Test Steps phase must contain the actions that are used in the test. If the test is part of a repeated or concurrent execution (by using a stub or a performance test), then the Test Steps phase is the only one that is executed for each iteration.
- Similar to initialization, the Tear-down phase
must be used only for deallocation of resources, termination of processes,
and so on. The Tear-down phase is only executed by the last test to
be processed when executed repeatedly or concurrently. Note: The Initialize and Tear-down phases are always run around the test, and the Tear-down phase runs even if the test fails. These phases are useful in stubs and performance tests where the body of the test is called multiple times, but actions within the other phases must run only once each.