Your Micro Focus product contains an example unit test and JCL job card that you can use together with a JES-enabled enterprise server region. Using the test runner syntax on the command line, you can run the unit test, which will submit the job card to the enterprise server region, and then query the resulting return code of the JCL job and perform a number of test assertions.
The example source files are located in the C:\Documents and Settings\All Users\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\UnitTests\JCL_COBOL\Example1 directory.
To run the test, you also need a running JES-enabled enterprise server region - the following example uses a region called ESMFUJCL, and a catalog located in the c:\ESMFUJCL\ directory.
To run the example:
cbllink -D MFUT_TXTDIFF1.cbl
This produces the required executable test file.
mfurun -sp -es-server-name:ESMFUJCL -es-syscat:c:\ESMFUJCL\CATALOG.DAT MFUT_TXTDIFF1.dll
Fixture : MFUT_TXTDIFF1 Executing test case : MFUT_TXTDIFF1
The test runs and a summary similar to the following should display:
Micro Focus COBOL - mfurun Utility Unit Testing Framework for Windows/Native/32 Fixture : MFUT_TXTDIFF1 Executing test case : MFUT_TXTDIFF1 JCLCM0188I J0001037 IEBCOM01 JOB STARTED 14:38:29 JCLCM0182I J0001037 IEBCOM01 JOB ENDED - COND CODE 0008 14:38:29 Completed test case : MFUT_TXTDIFF1 - Passed Generating report : MFUT_TXTDIFF1-report.txt Test Run Summary Overall Result Passed Tests run 1 Tests passed 1 Tests failed 0 Total execution time 4255
During the test run, the generated report (MFUT_TXTDIFF1-report.txt) was read by the COBOL program in order to make the test assertions shown in the summary.