xUnit support for Enterprise COBOL and PL/I
This customization task does not require
assistance, but does require the following resources or special customization
tasks:
|
Frameworks that assist developers in writing code to perform repeatable, self-checking unit tests are collectively known as xUnit. Developer for z/OS® provides such a framework for unit testing of Enterprise COBOL and PL/I code, called ZUnit.
AZU*
and IAZU*
load
modules in the FEL.SFELLOAD
load library, either
through STEPLIB or LINKLIST. The ZUnit test runner, AZUTSTRN
,
in turn needs access to various system libraries, either through STEPLIB
or LINKLIST:CEE.SCEERUN
andCEE.SCEERUN2
(LE runtime)SYS1.CSSLIB
(callable system services)SYS1.SIXMLOD1
(XML toolkit)
The ZUnit test runner also needs access to a load library that holds the different test cases. This library is likely to be unique to a developer.
AZUTSTRN
, can be called by the Developer for z/OS client
in batch mode, from the TSO command line, and from the z/OS UNIX command
line. When called in batch mode, the ZUnit test
runner can be used to unit test programs that interact with Db2.- Developer for z/OS provides
sample procedures,
AZUZUNIT
andAZUZUDB2
, to simplify the calling of the ZUnit test runner in batch mode. The sample procedures are located inFEL.#CUST.PROCLIB
, unless you specified a different location when you customized and submitted theFEL.SFELSAMP(FELSETUP)
job. For more details, see Customization setup.Customize the sample procedures, as described within the member, and copy them to
SYS1.PROCLIB
.The name of the procedure and the names of the steps in the procedure match the default properties that are included with the Developer for z/OS client. If the name of a procedure or the name of a step in a procedure is changed, the corresponding properties file on all of the clients must be updated. You should not change the procedure and step names.
If the procedures cannot be copied into a system procedure library, ask the Developer for z/OS users to add a JCLLIB card right after the JOB card to their calling job.//MYJOB JOB <job parameters> //PROCS JCLLIB ORDER=(FEL.#CUST.PROCLIB)
- For calling the ZUnit test runner
from z/OS
UNIX (using the
/usr/lpp/IBM/zee/bin/zunit
script), you can specify the required non-LINKLIST data sets in theSTEPLIB
directive ofzee.env
, thus simplifying the setup for the developer.zee.env
is located in/etc/zexpl/
, unless you specified a different location when you customized and submittedFEL.SFELSAMP(FELSETUP)
job. For more details, see Customization setup. You can edit the file with the TSO OEDIT command.The zunit script allows the user to specify data sets that will be added to the STEPLIB directive used by the script.
- For calling the ZUnit test
runner from the TSO command line by using the
FEL.SFELPROC(FEKZUNIT)
exec, the system libraries must exist in LINKLIST. If they do not, developers must specify the system data set names on every call instance of the ZUnit test runner. You can also write a wrapper exec that does the TSOLIB allocations of these data sets for them. You can useFEKZUNIT
itself as an example of how to code this wrapper exec. - To start a debugger session at the test target source, EQAOPTS
load module should be built and located in system search path like
STEPLIB.Note: EQAOPTS load module data set needs to be put before the DT SEQAMOD data set in the search path. It should contain the following macro so that ZUnit would specify the name of target source:
EQAXOPT DLAYDBG,YES EQAXOPT DLAYDBGDSN,'&&USERID.ZUNIT.DLAYDBG.EQAUOPTS
The ZUnit test runner allows for automatic reformatting of test reports.
z/OS Explorer Extensions provides sample
conversions (for example, conversion to Ant or jUnit format), which are located in
/usr/lpp/IBM/zee/samples/zunit/xsd
and
/usr/lpp/IBM/zee/samples/zunit/xsl
, if you installed Developer for z/OS in the default
/usr/lpp/IBM/zee
location.