Building test case programs

Use the Build Test Case action to build a test case that was generated for an Enterprise COBOL or Enterprise PL/I source program.

Before you begin

For information about known limitations for building test cases, see COBOL Limitations or PL/I Limitations.
Before you can use the Build Test Case action, you must complete these steps:
  1. Set compiler, JCL job card, and link options in a property group that is associated with the source program for which you want to build a test case. For instructions, see Setting property group options for a test case (COBOL) or Setting property group options for a test case (PL/I).
  2. Generate the test case. For instructions, see Creating/modifying a test case (COBOL) or Creating/modifying a test case (PL/I).
  3. When you build the test case generated as a local resource, upload the test case and the associated files. If multiple files are generated for the test case, make sure you upload all of them.
  4. Build the source program that is to be tested and any stub programs that are generated for subroutines. If the source program file name does not match the COBOL PROGRAM-ID or PL/I procedure name, then specify the PROGRAM-ID or procedure name as the load module name.
    COBOL Example: A COBOL source program named <HLQ>.ZUNIT.COBOL(ANAGRAM.cbl) specifies the following PROGRAM-ID in the identification division:
    
           IDENTIFICATION DIVISION.
            PROGRAM-ID. 'ANAGRA2'.
    PL/I Example: A PL/I source program named <HLQ>.ZUNIT.PLI(ANAGRAM.pli) specifies the following procedure name:
     ANAGRA2: procedure(anagramio_ptr) external;
    When you build the load module for either of these examples, specify the load module name as follows:
    Load Module Member Name window

Before building a test case, ZUnit checks whether the test target load module exists in the data set that is specified in the associated property group. If the test target load module exists in another data set, open the z/OS Automated Unit Testing Framework (ZUnit) Preferences window and clear the check box beside Check whether the test target load module exists before building test case.

The ZUnit preference page is at z/OS Automated Unit Testing Framework (ZUnit) in the Preferences window.

About this task

The Build Test Case action uses information that is stored in a property group and information that is stored in a test case generation configuration file to generate and submit JCL to build generated test case files. When you request the Build Test Case action, the build job creates a load module for the test case program. The build job stores the load module in the data set that is specified in the Load module location field on the Link page of the property group.

Procedure

  1. Select the source files.
    • For remote source files: In the Remote Systems or z/OS Projects view, select the source files for which you generated a test case.
    • For local source files: In the Remote Systems view, select the local source files.
  2. Right-click and select z/OS Automated Unit Testing Framework (ZUnit) > Build Test Case. For local source files: the Select Test Case dialog opens. Specify a test case to be built.
    The Build Test Case action generates and submits JCL to build the test case. The load module is stored in the location specified in the property group. The Select Test Case dialog window displays.
  3. Select the uploaded test case to be built and click OK.
    If the generated test case is large, it is generated by dividing it into multiple files. When you generate this test case as a local resource, make sure to upload all of the test case files before building.