Creating/modifying a test case

Use the Create/modify a test case window to create a ZUnit test case with test data for a remote Enterprise COBOL or Enterprise PL/I source file.

Before you begin

To create/modify a test case for a local file, see Creating/modifying a test case for a local source file for COBOL or Creating/modifying a test case for a local source file 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.

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 Remote Systems view or the z/OS Projects view, select a remote 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 or location of the configuration file.
    The Create/modify a test case window opens. Specify a test case name and description and click Next.
  3. Optional: To change the location for generating the test case program and other generated files, and to enable re-analysis, click Options.
    1. 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.
    2. Always analyze: Enable dependencies check or re-analysis before the Test Case Editor is opened even if the test target source is not updated.
    3. Capture file I/O: Change the option to capture file I/O each time a new test case is created. If you want to change it after recording test data, clean up the generated files first.
    4. Use preprocessor: Enable preprocessor before Test Case Editor is opened. This options appears when plugin extension for ZUnit preprocessor is provided and activated.
    5. To change the location of target container for the generated files, click Browse.
      The default location for the generated files is the location specified in the property group.
    6. To set or change COBOL or PL/I importer settings, click Change COBOL preferences or Change PL/I preferences.
      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.
  4. In the Test case name field, type a name for the test case file.
    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.
  5. Optional: To save the test case file to an existing location and overwrite its contents, select Replace.
  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.