Creating/modifying a test case for a local source file

Use the Create/modify a test case window to create a ZUnit test case for a Enterprise COBOL or Enterprise PL/I source file on the local workstation.

Before you begin

To create/modify a test case for a remote source file, see Creating/modifying a test case for COBOL or Creating/modifying a test case for PL/I.

For information about known limitations for creating/modifying test cases, see COBOL Limitations or PL/I Limitations.
  • Create a property group and associate it with the source program for which you want to generate a test case. Set property group options as described in Setting property group options for a test case (COBOL) or Setting property group options for a test case (PL/I).
  • The test case generation configuration file is created with the test source file name by default. To change the test case generation configuration file, select the Prompt to change the test case generation configuration file preference on the z/OS Automated Unit Testing Framework (ZUnit) Preferences window.
Tip: When you create/modify a test case for a source program file in a local project, you can use the Test Case Generation Configuration File window to specify a combined configuration file, which includes the Test Case Generation Configuration File (XML), the Test Data File (XML), and the Data Schema File (XSD) in a single .json file.

About this task

The Create/modify a test case window specifies options for creating/modifying a test case file. The generated test case file is a COBOL or PL/I program that provides a framework in which you can write tests. You can add multiple test entries to a test case. The framework provides the logic that is required to set up, run, and tear down the tests and calls the test runner programs that run the test case.

Procedure

  1. In the z/OS Projects view, select a local Enterprise COBOL or Enterprise PL/I source file.
  2. Select z/OS Automated Unit Testing Framework (ZUnit) > Create/modify Test Case
    Note: If you select the Prompt to change the test case generation configuration file option on the z/OS Automated Unit Testing Framework (ZUnit) Preferences window, then the Test Case Generation Configuration File window opens. You can use this window to change the name, location, or format of the configuration file.
    The Create/modify a test case window opens.
  3. Specify a test case name and description.
    By default, the test case name is generated by prefixing the target program file name with the test case prefix that is specified in the ZUnit Preferences page. You can change the prefix on the Preferences page. The test case name must be one to eight characters long and can contain alphabetic and numeric characters only.
    The entry you type is replicated in the Test case description field. It displays on test case results.
  4. Optional: To save the test case file to an existing location and overwrite its contents, select Replace.
  5. Optional: You can also set or change the following options for creating/modifying a test case:

    Test case folder name: Select a folder for the generated test case files. Click the drop-down button to choose from recently used folders, or click Browse to navigate to a different folder.

    Test case ID: The test case ID or universal unique ID generated for a test case program. If you do not specify a value here, the test case ID is generated when the program is created.

    Program types: Specify the program type. If the program is analyzed before and it contains specific program statements, the check boxes are selected by default. You can manually specify which types of statements the program contains. If the program is a Db2®/CICS®/IMS application that does not include those types of statements, you must specify the program types manually. CICS and IMS are shown only for COBOL. If you are testing a sub program called by a CALL statement in a CICS application, select the CICS check box and deselect the Specify LINKAGE option check box.

    Specify LINKAGE option: Select the check box to enable CICS LINKAGE option. Remove the check box to enable the NOLINKAGE option. When the target program is called from a CICS application and is compiled without CICS options, you should remove the check box.

    Always analyze: Enable dependencies check or re-analysis before the Test Case Editor is opened even if the test target source is not updated.

    Change COBOL preferences or Change PL/I preferences: Click to open the preference page for the COBOL importer or the PL/I importer. The wizard uses the importers to parse the source files for generating a test data schema.

    ZUnit uses the COBOL or PL/I importer to import source files for test data generation.
    • COBOL: If the source file is compiled with the NSYMBOL(DBCS) compiler option, be sure to select DBCS for the NSYMBOL option on the General page.
    • COBOL: If the source file handles DBCS, set the DBCS locale name, such as ja_JP, in the Compile time locale name field of the More COBOL options page.
    • PL/I: To create/modify a test case for a PL/I test target source file that uses a NOT symbol other than ˆ, specify the NOT symbol that it uses, such as ¬, on the More PL/I options page. When the NOT symbol or OR symbol on the PL/I options page, the specified first character is used in the generated Test Case program. Note: The symbol | cannot be specified as the NOT symbol. ZUnit Test Case use the | character for OR symbol, because LE library CEEIBMCT uses | when concatenation operations are included.
  6. To open the Test Case Editor, click Next.
    If any source files have dependent files, you can choose to import only the source file itself or to import the source file and its dependent files. The Test Case Editor opens and the Create/modify a test case window closes. Information that you entered on the Create/modify a test case window is saved to the test case generation configuration file. The next time you open the Create/modify a test case window, information is loaded into it from this file.
    Important: If the source file contains compilation errors, the Test Case Editor does not open. Correct any syntax errors in the source file and try the Create/modify Test Case action again.

What to do next

Use the Test Case Editor to add data to the test case.