This screen is accessed either by pressing F6 to create a new Test Environment or using option ‘7’ to define an existing one.
Environment Code This code must be unique within IASP (see below). It cannot be changed if amending an existing Environment.
Independent ASP If the environment libraries reside on an Independent Auxiliary Storage Pool (IASP) other than the default of *SYSBAS, the name of the IASP can be specified here (or selected using F4). Alternatively select *CURRENT to enable whichever IASP is specified for the current job to be used. The Environment can then contain libraries on the specified IASP and on *SYSBAS. This cannot be changed if amending an existing Environment.
Expand Option ‘2 – Freeze’ should be used if all desired objects in the Environment have been journaled and no additions are allowed, for example during the running of a Test Case or after taking option ‘1 – Scan’ from Work With Test Environments. Option ‘1 – Expand’ will allow any additional journaling to be set up.
Extended Rollback Support If set to ‘1’ TestBench will intercept and protect the commands RGZPFM, CLRPFM, CPYF, RMVM, DSPOBJD, ADDPFM, DLTF, CPYSPLF and CPYFRMIMPF. This means that if these commands are issued during the execution of a Test Case to replace data in or remove data from a database file, when the environment is rolled back these changes will be reversed and the original file reinstated. This is done in most cases by saving the object to a save file called SVnnnnnnnn which is stored in the journal library as specified on the Environment definition. When the rollback command is issued the save file is restored. To reduce the overhead on the rollback command, data volumes in files that will need to be rolled back in this way should be kept to a minimum.
If the option is set to ‘2’ these changes cannot be rolled back and the rollback pre-check will issue a warning message to that effect. If these commands are issued outside of a Test Case the changes cannot be reversed and the same pre-check message will be issued.
Rollback Mode This is the default run mode for any rollback operations in this Test Environment. Provided it is not prevented in System Values, this option can be overridden at execution time.
Journal Library This field can only be changed when F6 has been pressed to create a new Test Environment and is protected when changing an existing one. It determines where the TestBench journal will be created for objects that are not already journaled. If the non-journaled objects in the Test Environment are in a different ASP or IASP to the TestBench library, a library in the same ASP or IASP as the objects should be specified to enable the files to be journaled successfully. The default value is TB_JRN which is a library created during the TestBench installation.
Linked Environment During a test, all database changes made within the libraries specified against the Test Case Environment are captured and stored in the results set for the test run. This option enables database effects not only for the Environment specified against the test to be captured, but also any changes made in an additional Environment specified here. Therefore if your main database exists on an IASP but your test also updates files located on *SYSBAS for example, the *SYSBAS Environment can be specified here. This linked Environment can also reside on the same IASP as the main one. Please note that this linked Environment is not automatically kept synchronised with the main Environment, in other words it is not automatically rolled back at the same time. If this is required it must be handled manually.
Environment Libraries Determines which libraries will be controlled by this Environment and all files and data areas in these libraries will be journaled if not already. If a library is removed then journaling to the TestBench journal will be automatically ended. If the libraries are changed you will be prompted to re-scan the Environment to update the journal information. Any existing checkpoints will be inactivated. At any time F7 from the Work With Test Case Environments display can be used to locate a specific library within an Environment definition.
F7 – Libl This library list will be used when running a test with this Environment specified. If it is left blank the current library list will be used. (Note, the Test Case library list, if any, is ignored with Environment Protection).
Note: The Add/Change Environment screen changes according to the TestBench system value
“Enable System/36 Support”
When this value is on an additional parameter “System/36 Data Library” is added to the environment screen and the list of libraries changes to a list of prefixes.
In System/36 mode all data files are in one library and are then grouped by a prefix such as A.
A mix of S/36 and non S/36 environments can be created by blanking out the “System/36 Data Library” when this occurs the screen swaps back to a list of library names rather than prefixes.
By specifying a prefix all files that match the prefix are deemed part of the environment.
When the System/36 flag is off (Default) then the “System/36 Data Library” does not appear and a list of library names define the environment.
There may be occasions when some files present in an Environment should not be journaled and therefore not included in the rollback process. An example might be large audit files which can be updated without any need for these updates to be removed, or files which are shared by several applications and whose data cannot therefore be removed without affecting others. One option in dealing with these files would be to manually end journaling to the TestBench journal after the Environment has been scanned and then set the ‘Freeze’ option. However this means that any other files which are added to the libraries specified within the Environment will also not be journaled when the Environment is next scanned or a Test Case using it is next executed.
Manual exclusions present an alternative to ‘freezing’ the Environment. They enable specific files to be ignored while still ensuring that any additional files are included in the rollback process.
File Specify the name of the file to be excluded from journaling. Generic naming can also be used as shown above.
Library Specify either a specific library within the Test Environment or *ALL for all Environment libraries.
When Enter is pressed the following screen is displayed. As long as the Environment is not frozen, files which have been added to the exclusions will be un-journaled and files that have been removed will be journaled.
Manual exclusions can also be set up at the global level from within the TestBench system values in which case they will be applied to all Test Environments.