Running a test case from TSO

To run a z/OS® Automated Unit Testing Framework (ZUnit) test case from TSO, submit the FELZUNIT command from a host session.

Procedure

  1. To open the host connection emulator from the Remote Systems view, right-click your remote system connection name, and select Host Connection Emulator from the menu.
  2. Log in to TSO.
  3. Type the following command on the command line. Specify the location of your test runner configuration file by using the CFGDSN parameter and the location where you want the results to be written by using the RESDSN parameter.
     >>-- FELZUNIT --'--+-- CFGDSN(''HLQ.MLQ.AZUCFG(AZUCF001)'') --+-------->
                     |                                          |
                     +-- CFGDSN(MLQ.AZUCFG(AZUCF001)) ----------+
                     |                                          |
                     +-- CFGPATH(''/u/user/AZUCF001.azucfg'') --+
    
     >--+-- RESDSN(''HLQ.MLQ.AZURES(AZURS001)'') --+--------------------->
        |                                          |
        +-- RESDSN(MLQ.AZURES(AZURS001)) ----------+
        |                                          |
        +-- RESPATH(''/u/user/AZURS001.azures'') --+
    
     >--+-------------------------------+-------------------------------->
        |                               |
        +-- LOADDSN(''HLQ.MLQ.LOAD'') --+
                    ^              |
                    |              |
                    +-------,------+
    
     >----+-----------+--+-------------+--'-----------------------------><
          |           |  |             |
          +-- TRACE --+  +-- VERBOSE --+
    
     CFGDSN : the MVS data set location of the configuration file (input).
     CFGPATH: the HFS location of the configuration file (input).
              Note: CFGDSN and CFGPATH are mutually exclusive.
     RESDSN : the MVS data set location of the results file (output).
     RESPATH: the HFS location of the configuration file (output).
              Note: RESDSN and RESPATH are mutually exclusive.
     LOADDSN: a comma-separated list of load library data sets to append
              to the TSO search order for programs, for example,
              a library holding test case modules.
     TRACE  : enable test runner trace output.
     VERBOSE: enable verbose exec output.
    
    For more information about test runner parameters, see the related topics.

Results

The test runner runs the test cases that are defined in the configuration file and places the results in the result file. Use the ZUnit Runner Results viewer to see the test results.

Example

The following command runs test cases that are defined in a configuration file named ZUNIT.AZUCFG(AZUCFG001) with the following load library data sets:
  • SYS1.SIXMLOD1
  • CUST.RDZ.V85.SFELLOAD
  • ZUNIT.COBOL.LOAD
It writes the test results into the result file named ZUNIT.AZURES(AZURES001).
FELZUNIT CFGDSN(ZUNIT.AZUCFG(AZUCFG001)) RESDSN(ZUNIT.AZURES(AZURES001)) LOADDSN('SYS1.SIXMLOD1','CUST.RDZ.V85.SFELLOAD',ZUNIT.COBOL.LOAD) VERBOSE
The command output lists the arguments that are submitted with the FELZUNIT command, the TSO commands that are generated and issued by the EXEC, and the test runner output. The test case runs three tests, the third of which fails.
 IBM z/OS Automated Unit Testing Framework (ZUnit) REXX Exec
 @version aa3f6ee6-7f0d-48ae-9998-d41e64a82ba9
 ---------------------------------------------------------------------
 
 arguments:
 o CFGDSN, configuration XML MVS location: ZUNIT.AZUCFG(AZUCF001)
 o RESDSN, results XML MVS location: ZUNIT.AZURES(AZURS001)
 o LOADDSN, load library data sets: 'SYS1.SIXMLOD1','CUST.RDZ.V85.SFELLOAD',ZUNIT.COBOL.LOAD
 o VERBOSE, enable verbose exec output

 commands:
 o ALLOCATE DSNAME(ZUNIT.AZUCFG(AZUCF001)) DDNAME(AZUCFG)
 o ALLOCATE DSNAME(ZUNIT.AZURES(AZURS001)) DDNAME(AZURES)
 o TSOLIB ACTIVATE DDNAME(AZUCFG)
 o TSOLIB ACTIVATE DDNAME(AZURES)
 o TSOLIB ACTIVATE data set( 'SYS1.SIXMLOD1' 'CUST.RDZ.V85.SFELLOAD' ZUNIT.COBOL.LOAD )
 o CALL *(AZUTSTRN) ',/asis ' ASIS
 o TSOLIB DEACTIVATE
 o TSOLIB DEACTIVATE
 o TSOLIB DEACTIVATE
 o FREE DDNAME(AZUCFG)
 o FREE DDNAME(AZURES)

 ZUnit Test Runner 1.0.0.0 started at 2012-05-11T20:06:35.281...
 AZUTC001.test001 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:Eleven plus two.
 o WORD-BUF-1:WVUTSPONLLEEE  .
 o SECOND-WORD:Twelve plus one.
 o WORD-BUF-2:WVUTSPONLLEEE  .
 o RESULT=Y.
 ANAGRAM SUCCESSFUL
 AZUTC001.test001 Successful.
 AZUTC001.test002 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:The Morse code.
 o WORD-BUF-1:TSROOMHEEEDC  .
 o SECOND-WORD:Here come dots.
 o WORD-BUF-2:TSROOMHEEEDC  .
 o RESULT=Y.
 ANAGRAM SUCCESSFUL
 AZUTC001.test002 Successful.
 AZUTC001.test003 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:Snooze alarms.
 o WORD-BUF-1:ZSSROONMLEAA .
 o SECOND-WORD:Alas! No more Zs.
 o WORD-BUF-2:ZSSROONMLEAA!   .
 o RESULT=N.
 ANAGRAM SUCCESSFUL
 AZU1003S The test "AZUTC001.test003" failed due to an assertion. 
 The user-supplied text "ANAGRAM failed to detect that Snooze alarms
 is an anagram of Alas! No more Zs" is associated with the assertion.
 The test is a member of test case module "AZUTC001" which set a test
 case name of "AZUTC001 Test Case written in COBOL" and a UUID of 
 "e3a227e2-cd9e-4418-81b9-c4863ab3af3b" when initialized.
 AZUTC001.test004 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:Astronomer.
 o WORD-BUF-1:TSRROONMEA.
  o SECOND-WORD:Moon starer.
 o WORD-BUF-2:TSRROONMEA .
 o RESULT=Y.
 ANAGRAM SUCCESSFUL
 AZUTC001.test004 Successful.
  o Test count: 4
  o Tests passed: 3
  o Tests failed: 1
  o Tests in error: 0
 ZUnit Test Runner 1.0.0.0 ended at 2012-05-11T20:06:35.317.
The following command runs test cases that are defined in a configuration file named /u/userid/zunit/config/AZUCF001.azucfg with the following load library data sets:
  • SYS1.SIXMLOD1
  • CUST.RDZ.V85.SFELLOAD
  • ZUNIT.COBOL.LOAD
It writes the test results into the result file named /u/userid/zunit/result/AZUCF001.azures.
FELZUNIT CFGPATH('/u/userid/zunit/config/AZUCF001.azucfg') RESPATH('/u/userid/zunit/result/AZUCF001.azures') LOADDSN('SYS1.SIXMLOD1','CUST.RDZ.V85.SFELLOAD',
ZUNIT.COBOL.LOAD) VERBOSE
The command output lists the arguments that are submitted with the FELZUNIT command, the TSO commands that are generated and issued by the EXEC, and the test runner output. The test case runs three tests, the third of which fails.
 ---------------------------------------------------------------------   
 IBM z/OS Automated Unit Testing Framework (ZUnit) REXX Exec
 @version aa3f6ee6-7f0d-48ae-9998-d41e64a82ba9
 ---------------------------------------------------------------------   
 
 arguments:
 o CFGPATH, configuration XML HFS location: '/u/userid/zunit/config/AZUCF001.azucfg'
 o RESPATH, results XML HFS location: '/u/userid/zunit/result/AZUCF001.azures'
 o LOADDSN, load library data sets: 'SYS1.SIXMLOD1','CUST.RDZ.V85.SFELLOAD',ZUNIT.COBOL.LOAD
 o VERBOSE, enable verbose exec output
 
 commands:
 o ALLOCATE PATH('/u/userid/zunit/config/AZUCF001.azucfg') DDNAME(AZUCFG) PATHOPTS(ORDONLY)
 o ALLOCATE PATH('/u/userid/zunit/result/AZUCF001.azures') DDNAME(AZURES) PATHOPTS(OWRONLY,OCREAT) PATHMODE(SIRWXU,SIRGRP)
 o TSOLIB ACTIVATE data set( 'SYS1.SIXMLOD1' 'CUST.RDZ.V85.SFELLOAD' ZUNIT.COBOL.LOAD )
 o CALL *(AZUTSTRN) ',/asis ' ASIS
 o TSOLIB DEACTIVATE
 o FREE DDNAME(AZUCFG)
 o FREE DDNAME(AZURES)
 
 ZUnit Test Runner 1.0.0.0 started at 2012-05-11T20:08:39.069...
 AZUTC001.test001 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:Eleven plus two.
 o WORD-BUF-1:WVUTSPONLLEEE  .
 o SECOND-WORD:Twelve plus one.
 o WORD-BUF-2:WVUTSPONLLEEE  .
 o RESULT=Y.
 ANAGRAM SUCCESSFUL
 AZUTC001.test001 Successful.
 AZUTC001.test002 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:The Morse code.
 o WORD-BUF-1:TSROOMHEEEDC  .
 o SECOND-WORD:Here come dots.
 o WORD-BUF-2:TSROOMHEEEDC  .
 o RESULT=Y.
 ANAGRAM SUCCESSFUL
 AZUTC001.test002 Successful.
 AZUTC001.test003 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:Snooze alarms.
 o WORD-BUF-1:ZSSROONMLEAA .
 o SECOND-WORD:Alas! No more Zs.
 o WORD-BUF-2:ZSSROONMLEAA!   .
 o RESULT=N.
 ANAGRAM SUCCESSFUL
 AZU1003S The test "AZUTC001.test003" failed due to an assertion. 
 The user-supplied text "ANAGRAM failed to detect that Snooze alarms is 
 an anagram of Alas! No more Zs" is associated with the assertion. 
 The test is a member of test case module "AZUTC001" which set a test 
 case name of "AZUTC001 Test Case written in COBOL" and a UUID of 
 "e3a227e2-cd9e-4418-81b9-c4863ab3af3b" when initialized.
 AZUTC001.test004 Started...
 ANAGRAM STARTED...
 o FIRST-WORD:Astronomer.
 o WORD-BUF-1:TSRROONMEA.
 o SECOND-WORD:Moon starer.
 o WORD-BUF-2:TSRROONMEA .
 o RESULT=Y.
 ANAGRAM SUCCESSFUL
 AZUTC001.test004 Successful.
  o Test count: 4
  o Tests passed: 3
  o Tests failed: 1
  o Tests in error: 0
 ZUnit Test Runner 1.0.0.0 ended at 2012-05-11T20:08:39.096.