Configuring the test runner

Use the IBM z/OS Automated Unit Testing Framework (ZUnit) Runner Configuration editor to add test cases and set options for handling errors or failures.

Before you begin

  1. Create a test runner configuration file. For instructions, see the related topics.
  2. Create one or more test cases to add to the test runner configuration. For information about creating test cases, see the related topics.
  3. Verify file mappings for the configuration and results files.
    Open the z/OS File System Mapping view and look for the following entries:
    Mapping Criterion Workstation File Extension Transfer Mode Host Code Page Local Code Page
    **AZUCFG azucfg binary UTF-8 UTF-8
    **AZURES azures binary UTF-8 UTF-8
    **AZUGEN xml binary UTF-8 UTF-8
    **AZUSCH xsd binary UTF-8 UTF-8
    **AZUTDT xml binary UTF-8 UTF-8
    If these entries do not exist, do one of these steps:
    • Create a workspace. Workspaces created by Rational Developer for System z version 8.5 or later include these mappings.
    • Add mappings with these characteristics to your current workspace. For instructions for creating file mappings, see Mapping data sets and partitioned data set members.
    • If push-to-client support is enabled on the remote system, you can add these mappings to the z/OS file system mapping configuration files so that they are downloaded to each client when it connects to the remote system. For more information about push-to-client, see Distribution of updates by using push-to-client.

About this task

If you use the Run As Test Case or Run All As Test Case action to run all the tests of a test case, you do not have to create a configuration file manually. The test runner generates a configuration file for you. For more information about these actions, see Running a test case from an executable file or load library and Running a test case from a source file.
ZUnit test runner results are generated when you run a test case. The test results are stored in a file in the location you point to in the property group. Developer for z/OS supports four formats for test result files:
  • Version 1.0.0.0, which is supported by Rational Developer for System z version 8.5.1 and earlier.
  • Version 2.0.0.0, which is supported by Rational Developer for System z version 9.0 and earlier. This version was developed to provide compatibility with JUnit test results.
  • Version 2.1.0.0, which is supported by IBM Developer for z Systems version 14.1 and earlier. This version was developed to provide run/debug/code coverage for selected tests.
  • Version 3.0.0.0, which is supported by IBM® Developer for z/OS version 14.2.1 and earlier. This version was developed to provide results for the z/OS Dynamic Test Runner.
For version 2.1.0.0 test results, for example, the viewer provides actions for exporting error/failed tests and the specified test.
To determine the version of a configuration file:
  1. Open your .azucfg file in a text editor.
  2. Look at the <RunnerConfiguration> tag in the file. The xmlns attribute refers to the version of the test runner:
    • Version 1.0.0.0: xmlns="http://www.ibm.com/ZUnit/1.0.0.0/TestRunner"
    • Version 2.0.0.0: xmlns="http://www.ibm.com/ZUnit/2.0.0.0/TestRunner"
    • Version 2.1.0.0: xmlns="http://www.ibm.com/ZUnit/2.1.0.0/TestRunner"

Adding test cases

Procedure

  1. To open the editor, double-click the test runner configuration file, or right-click a COBOL or PL/I source file for which test case has been generated and built, and then select z/OS Automated Unit Testing Framework (ZUnit) > Open Runner Configuration.
    The IBM z/OS Automated Unit Testing Framework (ZUnit) Runner Configuration editor opens.
  2. To add a test case, select ZUnit runner and click Add.
    The Add item window opens.
  3. Select Test case and click OK.
    A test case entry is added to the ZUnit runner list. The editor opens the Details area for the test case entry.
  4. In the Details area, click Browse.
    The Browse for File window opens. The browser contains a list of remote systems and projects.
  5. Locate the remote system or project where your test cases are stored and expand that node until you find your test cases.
  6. Select the test case and click OK.
    The test case entry in the ZUnit runner list is updated with the test case name.
  7. Repeat steps2 through 6 until all test cases are added to the configuration.
  8. To remove a test case, select it and click Remove.
  9. To reorder a test case in the list, select it and click Up or Down.

Setting test to be skipped

About this task

The test skip settings determine which tests are skipped in running/debugging/code coverage. If the test is not marked with "skip", it will run. Therefore, all the tests will run with the older version of the runner configuration.

Procedure

  1. Select the test in the left tree view.
  2. Select the Skip the test checkbox.

Setting test runner options

About this task

The runner continuation settings determine how the runner operates under failure or error conditions. When a condition is selected, the runner continues operating under that condition. When it is cleared, the runner stops under that condition. If the Continue if test fails condition is selected, for example, then the runner continues operating when a test fails; if the condition is cleared, then the runner stops when a test fails.

For each test, you can indicate whether the test is skipped or not. You cannot clear Skip the test for Test(dummy). For each test, you can indicate whether or not to stub another program call.

Procedure

  • To enable a continuation condition, select the check box.
  • To disable a continuation condition, clear the check box.
  • To clear all continuation settings, click Clear Optional Item.
  • To enable a skip condition, select the check box.
  • To disable a skip condition, clear the check box.
  • To enable a stubbing condition, select the check box.
  • To disable a stubbing condition, clear the check box.