Running a test case from an executable file or load library

To run a test case from an executable file or load library, select the file and then select z/OS Automated Unit Testing Framework (ZUnit) > Run As Test Case or z/OS Automated Unit Testing Framework (ZUnit) > Run All As Test Case.

Before you begin

  1. Create a property group and set compiler and test runner options for the test case:
  2. Associate the property group with the file or load library that you want to run as a test case.
  3. If you want to run a test case that simulates QSAM or VSAM file I/O operations, allocate the necessary data sets and specify DD statements for file I/O in the Additional JCL field of the Procedures and Steps page on the ZUnit tab of the property group. To edit the Additional JCL field, expand the AZUZUNIT JCL procedure, and then select the RUNNER step.

About this task

ZUnit provides two menu options for running a test case from an executable file or a load library:
  • z/OS Automated Unit Testing Framework (ZUnit) > Run As Test Case runs a single executable file as a test case. The file must be a data set member with an .exe extension.
  • z/OS Automated Unit Testing Framework (ZUnit) > Run All As Test Case runs a load library as a test case. The load library must be a data set that contains at least one member with an .exe extension.
Note: ZUnit does not support allocating data set for working file automatically when running a test case from an executable file or load library.

Procedure

  1. To run a test case from theRemote Systems view or z/OS Projects view, do one of the following actions:
    • Right-click an executable file and select z/OS Automated Unit Testing Framework (ZUnit) > Run As Test Case.
    • Right-click a load module and select z/OS Automated Unit Testing Framework (ZUnit) > Run All As Test Case.
    The Run As Test Case or Run All as Test Case window opens. This window verifies the location of the test runner configuration file and the test runner result file.
    The field names on this window vary according to the location for the configuration and result files that you specify in the property group.
    • If you specify a folder on a z/OS UNIX file system, then the field names are Folder name, File name, and Overwrite file.
    • If you specify a data set on an MVS™ file system, then the field names are Data set name, Member name, and Overwrite member.
    The Folder name and Data set name fields are read only. Their values are taken from the property group that is associated with the executable file or load library.
  2. Specify the file or member names for the configuration and result files and choose an overwrite option for each file.
    The default value for the configuration and result file names is the test case name. If you enter a different value for these file names and open the Run As Test Case or Run All As Test Case window again, the configuration file and result file names default to the test case name.
  3. Click OK.
    If the executable file or load library has an associated property group, then the test runner starts. If the file or library does not have a property group that is associated with it, then the Missing Property Group window opens. On this window, you can do one of the following actions:
    • Click Cancel. The test case is not run.
    • Click Create and associate a property group. The test case is not run. The property group editor opens. You can use this editor to create a property group and associate it with the file or library. To run the test case, you must request the Run As Test Case or Run All As Test Case action again.
    • Click Associate an existing property group. The Associate Property Group window opens. Use this window to choose a property group that is configured to support ZUnit test cases. After you associate the property group, the test case is run.
    • Click Do not associate a property group. The test case is not run.

Results

When a test case is run, the ZUnit test runner starts and completes the following actions:
  1. Generates a test runner configuration file with the properties that you specified in the property group.
  2. Runs the test case. ZUnit submits a JES job to run the test runner with the uploaded runner configuration file.
  3. If the test runner is successful, it generates a test result file with the properties that you specified in the property group.
  4. Opens the result file in the IBM z/OS Automated Unit Testing Framework (ZUnit) Runner Results viewer.

What to do next

For more information about test case results, see Viewing test case results.
For help with any error messages that are displayed as a result of errors in your test case, property group, configuration file, or the test runner job submission, see the following topics: