Deprecated Total Test Unit Test CLI (TotalTestCLI.bat)

The Total Test Unit Test CLI runs Total Test unit tests. The test suite or scenario must have been defined in the Total Test Unit Test Eclipse client. The command line tools expect a complete Total Test Unit Test project structure.

Warning

The Total Test Unit Test CLI has been deprecated and will be removed in a future release. Instead, the TotalTestFTCLI.bat CLI, described before, should be used. It can handle execution of unit test scenarios as well as Total Test scenarios.

Usage

Executing unit test scenarios is done with the TotalTestCLI.bat file. The general syntax for using the TotalTestCLI.bat is:

TotalTestCLI.bat -cmd=<command> options

The most important command is the runtest command, which will execute all of the other commands in sequence. Each command uses an individual set of options and can be seen in details in later sections.

Complete end-to-end run

Use the runtest command to perform a complete end to end run of a Total Test test suite or test scenario. See Test Runner for more information. 

Example
TotalTestCLI.bat -cmd=runtest -h=mfhost -pt=10239 -u=tsoab71 -pw=AKznXY -p=c:\Users\Username\Compuware\Workbench\workspace\TotalTestProject -ts=CWXTCOB_Scenario.testscenario -te=1047 -j=Runner.jcl

This example will execute all the test cases in "CWXTCOB_Scenario.testscenario" for project "TotalTestProject" on host "mfhost" using port "10239" and log on information UserID "tsoab71" with password "AKznXY" and submit "Runner.JCL".

Execute individual steps

If you want to execute the individual steps, one at a time, to run a test, execute them in this order:

  1. Use the build command to create the binary input files for the test cases using the Binary Builder. See Binary Builder for more information.
  2. Use the upload command to upload the binary files created by the Binary Builder to the mainframe. See File Transfer for more information.
  3. Use the submit command to submit the JCL to execute the Total Test Runner on the mainframe.

    The binary files need to be uploaded before submitting the JCL to execute the Test Runner. See JCL Submit for more information.

  4. Use the download command to retrieve the result from the mainframe Total Test Test Runner execution. See File Transfer for more information.
  5. Use the parse command to unpack the binary test results file created by the Total Test Runner. See Binary Parser for more information.
  6. Use the resultcheck command to analyze the test results against the test check conditions. The result checker will output test archive files containing the test results. See Result Checker (#result-checker-parameters-options) for more information.

The batch script is in the directory where the Workbench for Eclipse CLI was installed. To execute the script, the configuration directory must be writable.

Tip

If you install CLI in the default location (C:\Program Files\Compuware\Workbench for Eclipse CLI) or a Read-only location, you must add the -data parameter to specify the path to your workspace, for example:

TotalTestCLI.bat -cmd=<command> options -data=C:\Users\Username\Compuware\Workbench\workspace

The error message The configuration area at C:\Program Files\Compuware\Topaz Workbench CLI\configuration is not writable. Please choose a writable location using the '-configuration' line command. is an indication that the -data parameter is required.

A challenge with using the individual commands in sequence - instead of using the runtest command - is that using the upload, the CLI will 'randomly' generate names for the target binary files on the mainframe (To be more precise, the 'ID' qualifier is generated randomly). Currently, there is no known, simple way to control these names or determine which names have been generated. Therefore, we will concentrate on the runtest command.

CLI commands

The following table lists the valid commands to invoke from the command line. For options, see the parameters explained in the following table for each CLI component.

CommandComponentDescription
buildBinary BuilderParses a test suite or test scenario and creates the required binary files.
uploadFile TransferUploads the parsed local binary files to the target host system.
submitJCL SubmitSubmit JCL to run a test.
downloadFile TransferDownloads the test results from the target host to a local file.
parseBinary ParserParses the local binary result file and updates the archive (history).
resultscheckResult CheckerParses the updated archive (history), applying the check conditions to the output data and updating the archive accordingly.
runtestTest RunnerPerforms all the above commands (in the specified order).

All options have the following format: parameter=value. If the value contains spaces, the entire option must be enclosed in quotes, for example: "-t=c:\TotalTestProject\Unit Test\Suites\SimpleTest.testsuite". To set the logging level of the CLI tools logging output, see Debug Options.

Debug options

The following table lists the debug parameters that can be used for all commands.

ParameterAbbr.Description
-loglevel-logThe logging level. Must be INFO, WARN, DEBUG or ERROR. The default is INFO.
-logparms-lpIndicates if the various components run parameters should be logged before the run. Must be TRUE or FALSE. The default is TRUE.

Test Runner - parameters/options

The Test Runner component enables the complete end to end run of a Total Test test suite or test scenario. The following tables list the input and optional parameters that must be provided in addition to the required parameters for all CLIs, i.e. host, port, user, and password :

Test Runner input parameters

Parameter/OptionAbbr.Description
-host-hThe host name or IP address of the target host.
-port-ptThe port the host is listening on.
-user-uThe name of the user (userID) to connect to the host with.
-password-pwThe password associated with the userID.
-project-pThe Total Test project folder.
-testsuite-tsThe name of a test suite from the Suites folder or the name of a test scenario from the Scenario folder.
-testsuitelist-tslSpecifies a comma delimited list of test scenarios/suites names to be run. Test scenarios/suites names can contain the wildcard characters asterisk (*) to indicate any characters or a question (?) to indicate a single character. 'All_Scenarios' can be used to run all scenarios. 'All_Suites' can be used to run all test suites.
-jcl-jThe name of a JCL file from the JCL folder.
-jcldsn-jdsnThe name of a data set containing the JCL to submit.
-targetencoding   -teThe character encoding (charset) used on the target platform. Default is '1047'.
-noreport
If specified with the -p option, no report file will be created.
-noresult


If specified with the -p option, no result file will be created.
-nojunit
If specified with the -p option, no JUnit file will be created.
-nosonar
If specified with the -p option, no Sonar file will be created.
-ccrepository-ccrepoThe name of the Code Coverage repository dataset. Must be specified to enable Code Coverage.
-ccsystem-ccsysCode Coverage system. If not specified with '-ccrepo', defaults to the test suite or test scenario name.
-cctestid-cctidCode Coverage test id. If not specified with '-ccrepo', defaults to the test suite or test scenario name.
-ccstepname-ccstep

Specifies the Total Test step name. Should be used if the Total Test step is contained in a cataloged procedure.

-ccprogramtype       -cctypeSpecifies the main executable program (this is the program specified on the 'EXEC PGM=' JCL statement in runner*.JCL) for Code Coverage. Specify: (-cctype=DB2 when the main program is IKJEFT01 or IKJEFT1B for live Db2, -cctype=TOTALTEST when the main program is TTTRUNNR, -cctype=IMS when the main program is DFSRRC00 for live IMS)
-ccclearstats        -ccclearSpecifies whether the Code Coverage repository statistics should be cleared before running the test. Valid values are 'true' or 'false'. The default value is 'true'.
-externaltoolsworkspace-etwsSpecifies the workspace of an external tool. This argument requires the 'postruncommands' argument be specified.
-postruncommands-prcSpecifies the commands to be run after test completion. Currently only 'CopyJUnit' and 'CopySonar' are supported. If both are specified, they should be separated by a comma. This command requires the 'externaltoolsworkspace' argument be specified. 'CopyJUnit' will copy the JUnit results to the directory TTTJUnit, in the location specified by the external tools workspace argument. 'CopySonar' will copy the Sonar results to the directory TTTSonar, in the location specified by the external tools workspace argument.

Tip

-jcl and -jcldsn cannot both be used in the same statement. Specify either -jcl or -jcldsn.

Test Runner optional parameters

Parameter/OptionAbbr.Description
-dsnhlq-hlqHigh level qualifier to be used when allocating data sets.
-wait-wIndicates if component waits for test completion. Must be TRUE or FALSE. The default is TRUE.
-maxwait-mwThe number of minutes to wait for the test to complete. The default is 20 minutes.
-useStubs-usIndicates if the test should use stubs. Must be TRUE or FALSE. The default is TRUE.
-backuparchive  -baIndicates if the archive file should be backed up. The file will be time stamped and placed in the History project folder. Must be TRUE or FALSE. The default is TRUE.
-deletetemp-dtIndicates if temporary files are to be deleted. Must be TRUE or FALSE. The default is TRUE.

Example of using runtest

The following example will execute the suite CWXTSUBC.testsuite residing in Total Test project project=C:\Users\cwde-rnuesse\Compuware\Topaz\Workspace\Unit CWXTSUBC 1.0, on host my.mainframe.host, communicating on port 16196, using the Runner.jcl file for the job to submit.

@echo off

REM
REM Script to submit JCL using the Topaz CLI
REM 
REM **********************************************************
REM Configuration Variables for the Script
REM
REM Change according to your environment
REM 
REM **********************************************************
REM
REM CLIPath  Installation Path of your Topaz CLI 
REM
REM JAVA_HOME Installation Path of Java
 
SET "CLIPath=C:\Program Files\Compuware\Topaz Workbench CLI 1921\"
SET "workspace=C:\Users\cwde-rnuesse\Compuware\Topaz\TopazCLIWorkspace"
SET "host=my.mainframe.host"
SET "port=16196"
SET "codepage=1047"
SET "user=++++++++"
SET "pw=********"

SET "project=C:\Users\cwde-rnuesse\Compuware\Topaz\Workspace\Unit CWXTSUBC 1.0"
SET "suite=CWXTSUBC"
SET "JCL=Runner.jcl"

"%CLIPath%"TotalTestCLI.bat -data=C:\Users\cwde-rnuesse\Compuware\Topaz\TopazCLIWorkspace -cmd=runtest -host=%host% -port=%port% -user=%user% -pw=%password% "-project=%project%" "-testsuite=%suite%.testsuite" -te=%codepage% "-j=%JCL%"

Binary Builder - parameters/options

The Binary Builder component parses a test suite or test scenario and creates the binary input file (containing the binary input data), and the reference file (containing the test case references). The following tables lists the input, output, and optional parameters that must be provided.

Input parameters

ParameterAbbr.Description
-testsuite-t Test suite or test scenario name, if project is specified. Otherwise must be the full path name to the test suite or test scenario.
-targetencoding-teThe character encoding (charset) used on the target platform. Default is '1047'.

Output parameters

ParameterAbbr.Description
-archive-aThe archive created containing all test data. See Optional Parameters for more information.
-binput-binThe binary input data file. See Optional Parameters for more information.
-binref-brfThe binary reference file. See Optional Parameters for more information.

Optional output parameters

ParameterAbbr.Description
-project-p

The Total Test project folder. If specified, the archive, binary input file and reference file do not need to be specified. The files will be placed on the associated project folders.

File Transfer - parameters/options

File Transfer transfers binary files to and from the target host. The following tables list the input, common, and upload parameters that must be provided: File Transfer Input Parameter.

ParameterAbbr.Description
-command-cmdThe command to be executed. Must be either 'upload' or 'download'.

File Transfer common parameters

ParameterAbbr.Description
-host-hThe host name or IP address of the target host.
-port      -ptThe port the host is listening on.
-user-uThe name of the user (userID) to connect to the host with.
-password-pwThe password associated with the userID.
-targetencoding-teThe character encoding (charset) used on the target platform. Default is '1047'.

File Transfer upload parameters

ParameterAbbr.Description
-bininp-binThe binary input data file produced by the builder.
-binref-brfThe binary reference file produced by the builder.
-dsnhlq-hlqOptional high level qualifier to be used when allocating data sets.

File Transfer download parameters

ParameterAbbr.Description
-binres-brsThe binary result file to be written to.
-binresdsn-brsdsnThe BINRES dataset name on the target host to be downloaded.

JCL Submit - parameters/options

The JCL submit component submits JCL to run the test(s) on the target host. The JCL can reside on the local files system (use parameter -j) or as a data set on the target host (use parameter -jdsn). The following tables list the submit, and optional parameters that must be provided.

JCL Submit Parameters

ParameterAbbr.Description
-host     -hThe host name or IP address of the target host.
-port-ptThe port the host is listening on.
-user-uThe name of the user (userID) to connect to the host with.
-password-pwThe password associated with the userID.
-targetencoding-teThe character encoding (charset) used on the target platform. The default is �1047�.
-bininpdsn-bindsnThe BININP dataset name on the target host, to use for the test run. This is only required if the JCL requires substitution.
-binrefdsn-brfdsnThe BINREF dataset name on the target host, to use for the test run. This is only required if the JCL requires substitution.
-binresdsn-brsdsnThe BINRES dataset name on the target host, to use for the test run. This is only required if the JCL requires substitution.
-ccrepository -ccrepoThe name of the Code Coverage repository dataset. Must be specified to enable Code Coverage.
-ccsystem-ccsysCode Coverage system. If not specified with '-ccrepo', defaults to the test suite or test scenario name.
-cctestid-cctidCode Coverage test id. If not specified with '-ccrepo', defaults to the test suite or test scenario name.
-ccstepname-ccstep

Specifies the Total Test step name. Should be used if the Total Test step is contained in a cataloged procedure.

-ccprogramtype-cctypeSpecifies the main executable program (this is the program specified on the 'EXEC PGM=' JCL statement in runner*.JCL) for Code Coverage. Specify: -cctype=DB2 when the main program is IKJEFT01 or IKJEFT1B for live Db2 -cctype=TOTALTEST when the main program is TTTRUNNR -cctype=IMS when the main program is DFSRRC00 for live IMS.
-ccclearstats-ccclearSpecifies whether the Code Coverage repository statistics should be cleared before running the test. Valid values are 'true' or 'false'. The default value is 'true'.

JCL submit parameter from Local Host

ParameterAbbr.Description
-jcl-jThe file name containing the JCL to submit.

JCL submit parameter from z/OS data set

ParameterAbbr.Description
-jcldsn-jdsnThe name of a data set containing the JCL to submit.

Tip

-jcl and -jcldsn cannot both be used in the same statement. Specify either -jcl or -jcldsn.

JCL submit optional parameters

ParameterAbbr.Description
-wait  -wIndicates if component waits for test completion. Must be true or false. Defaults to true.
-maxwait-mwThe number of minutes to wait for the test to complete. The default is 20 minutes.

Binary Parser - parameters/options

The Binary Parser component parses the binary result file from an executed test and updates the archive file. The following table lists the input parameters that must be provided.

Binary Parser input parameters

ParameterAbbr.Description
-binres-brsThe binary result data file which was the output of the test execution on the target platform.
-targetencoding-teThe character encoding (charset) used on the target platform. Default is '1047'.
-archive-a The archive (history) created by the Builder which will be updated.

There are no explicit output parameters. The Parser output data will be saved in the updated archive file.

Result Checker - parameters/options

The Result Checker component parses the archive, applying the check conditions to the output data and updating the archive accordingly. In addition to that, the Result Checker will create a separate results file and report file. For details about the contents of these file, please refer to the section about Project Structure in the Total Test online help. The following tables list the input, output and optional parameters that must be provided.

Result Checker Input Parameters

ParameterAbbr.Description
-archive-aThe archive from the Parser which will be updated (unless the output parameter is used, see below).

Result Checker optional input parameters

ParameterAbbr.Description
-targetencoding-teThe character encoding (charset) used on the target platform. Defaults to the encoding stored in the archive.

Result Checker output parameters

ParameterAbbr.Description
-result-rsThe name of the XML result fle to be created. (Not required when project parameter is provided.)
-noresult
If specified with the -p option, no result file will be created.
-report-rpThe name of the HTML result report to be created. (Not required when project parameter is provided.)
-junit        -juThe full path name of the file to write the JUnit information to. It is a XML document describing the results, intended for JUnit displays.
-sonar-soThe full path name of the file to write the Sonar information to. It is a XML document describing the results, intended for Sonar displays.
-noreport               
If specified with the -p option, no report file will be created.
-nojunit
If specified with the -p option, no JUnit file will be created.
-nosonar
If specified with the -p option, no Sonar file will be created.
-externaltoolsworkspace-etwsSpecifies the workspace of an external tool. This argument requires the 'postruncommands' argument be specified.
-postruncommands-prc

Specifies the commands to be run after test completion. Currently only 'CopyJUnit' and 'CopySonar' are supported. If both are specified, they should be separated by a comma. This command requires the 'externaltoolsworkspace' argument be specified.

'CopyJUnit' will copy the JUnit results to the directory TTTJUnit, in the location specified by the external tools workspace argument.

'CopySonar' will copy the Sonar results to the directory TTTSonar, in the location specified by the external tools workspace argument.

Binary Parser optional output parameters

ParameterAbbr.Description
-outputarchive        -oarA new archive to be created instead of updating the input archive. Default is to update the input archive.
-project-pPath to the project folder. If provided, the result and report parameters can be omitted, and their file names will be automatically derived. This parameter has no default.
-fileencoding-feThe character encoding to be used for output files. Defaults to UTF-8.
-save-sSave output or not. Set to TRUE to write output, or FALSE for no output. When set to FALSE, no files will be created and the archive will not be updated. Defaults to TRUE.


Was this page helpful? Yes No Submitting... Thank you

Comments