Import data into the AZUTC004.cbl test case

In the Test Case Editor, you can import data into a test case, and then generate, build, and run the AZUTC004.cbl test case to see the test results for the imported data.

Importing data

Before you begin

This procedure uses a sample program included with IBM® Developer for z/OS®. It also uses a z/OS project that was created by the sample setup procedure. Before using this procedure:
  1. Set up the sample files by using the instructions in Setup instructions.
  2. Create/modify a test case for the sample file by using the instructions in Create/modify a test case from TOURFILE.cbl.
  3. Add data, and generate, build, and run the test case by using the instructions in Add data to the AZUTC004.cbl test case.

About this task

During the first test case run of the AZUTC004.exe test case, the test case program generated the following input and output data files on the remote system:
  • <HLQ>.ZUNIT.IO.TOURFILE.INFILE
  • <HLQ>.ZUNIT.IO.TOURFILE.OUTFILE
These sequential data sets were allocated by using the data set name and allocation characteristics that are defined on the Generation Options page of the property group that is associated with the project. This procedure uses these generated data files to import data into a test entry for the AZUTC004.cbl test case.

Procedure

  1. In the Test Case Editor, click the Import Test File Data As Stub toolbar button.
    Import Test Data toolbar button
    The Import Test Data window opens.
    Import Test Data window
  2. Select the TOURMST output file, and then click Browse.
  3. In the Browse for File window, navigate to the <HLQ>.ZUNIT.IO.TOURFILE.OUTFILE data set that was generated on the remote system, select that file, and click OK.
    Browse for File window
  4. In the Number of imported records field of the Import Test Data window, specify 2, and then click OK.
    Import Test Data window
    ZUnit generates JCL and submits a job to import output data from the data set into a new test entry named AZUE0000. The output data is added to Record1 and Record 2 of TOURMST in the AZUE0000 expected output column.
    Test Case Editor with imported data
  5. Double-click the table cell in row CHECK_CODE and column AZUE0000: Input, and then type N in the cell.
  6. Copy the values for the TOURDATA parameters from Record1, Record2, and Record3 of TEST1 to Record1, Record2, and Record3 of the AZUE0000 test.
    Test Case Editor with parameter values for AZUE0000 test entry
  7. Generate, build, and run the test case with test data in AZUE0000:
    1. In the Test Case Editor, click the Generate toolbar button.
      The Test Case Editor prompts you to save the changes.
    2. Click Yes.
      The Generate test case programs window opens.
    3. Right-click the TOURFILE.cbl source file and click z/OS Automated Unit Testing Framework (ZUnit) > Build Test Case. ZUnit generates JCL and submits a job to build the test case, and then prompts you to run the test case.
    4. Click Yes. The Run As Test Case window opens.
    5. Select the Overwrite member check box for both the runner configuration file and the runner result file.
    6. Click OK.
      The ZUnit test runner starts and runs the TEST1 test and the AZUE0000 test. After the test completes, the ZUnit Runner Results view opens and shows that both tests passed.
      TTOURFIL Test Runner Results

Results

The test case generation adds the following files to the z/OS Projects view:
  • A0000002.xml: The data file for the TOURDATA parameters for test entry AZUE0000.
  • C0000003.xml: The data file for the TOURMST parameters for test entry AZUE0000.
  • AZC0000D.cbl: The output file result evaluation stub program generated to simulate I/O for the TOURMST output parameters.
  • *.lst: Listing files for the build operation.
  • *.exe: The load module that were generated by the build operation.
  • *.obj: Object files generated by the build operation.

What to do next

Use test results to correct an error in the TOURFILE.cbl program