How to Set Up and Use Test Environments

  1. Get your data to the state you require (we recommend also taking a back up).
  2. Create a Test Environment in Work With Test Environments specifying the libraries that make up the environment. When you perform tests in this environment if a specific library list is to be used, define this with F7.
  3. Define and set at least one Checkpoint, and set this to identify to TestBench the current state of the environment.
  4. Against your Test Case, change the Data Protection option to *ENV (in the Test Options window) and name the environment you are using.
  5. Probably, you will want to remove any Manual References against the Test Case.
  6. Perform your first batch of tests.
  7. Create and set a new Checkpoint to capture this point in time.
  8. Continue testing and creating Checkpoints as required.
  9. The test results will include file and data area effects and hence Data Rules may also be checked.
  10. If you need to reset the database at any time, use the rollback option against a selected Checkpoint.

Three commands for use with Environment Protection are also available so that for example, these functions can if required be incorporated into User Exits in a Test Case or added as Test Case Processes:-

  • Scan_IT – Scan a Test Environment
  • Mark_IT – Set a Checkpoint
  • Roll_IT – Issue a rollback to a Checkpoint

There are two Test Case User Exits which monitor for the rollback command, BR (Before Rollback) and AR (After Rollback). These enable the specified user processing to be run every time the ROLL_IT command is executed during the test.