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.
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:
- Use the
build
command to create the binary input files for the test cases using the Binary Builder. See Binary Builder for more information. - Use the
upload
command to upload the binary files created by the Binary Builder to the mainframe. See File Transfer for more information. 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.
- Use the
download
command to retrieve the result from the mainframe Total Test Test Runner execution. See File Transfer for more information. - Use the
parse
command to unpack the binary test results file created by the Total Test Runner. See Binary Parser for more information. - 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.
Command | Component | Description |
---|---|---|
build | Binary Builder | Parses a test suite or test scenario and creates the required binary files. |
upload | File Transfer | Uploads the parsed local binary files to the target host system. |
submit | JCL Submit | Submit JCL to run a test. |
download | File Transfer | Downloads the test results from the target host to a local file. |
parse | Binary Parser | Parses the local binary result file and updates the archive (history). |
resultscheck | Result Checker | Parses the updated archive (history), applying the check conditions to the output data and updating the archive accordingly. |
runtest | Test Runner | Performs 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.
Parameter | Abbr. | Description |
---|---|---|
-loglevel | -log | The logging level. Must be INFO, WARN, DEBUG or ERROR. The default is INFO. |
-logparms | -lp | Indicates 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/Option | Abbr. | Description |
---|---|---|
-host | -h | The host name or IP address of the target host. |
-port | -pt | The port the host is listening on. |
-user | -u | The name of the user (userID) to connect to the host with. |
-password | -pw | The password associated with the userID. |
-project | -p | The Total Test project folder. |
-testsuite | -ts | The name of a test suite from the Suites folder or the name of a test scenario from the Scenario folder. |
-testsuitelist | -tsl | Specifies 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 | -j | The name of a JCL file from the JCL folder. |
-jcldsn | -jdsn | The name of a data set containing the JCL to submit. |
-targetencoding | -te | The 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 | -ccrepo | The name of the Code Coverage repository dataset. Must be specified to enable Code Coverage. |
-ccsystem | -ccsys | Code Coverage system. If not specified with '-ccrepo', defaults to the test suite or test scenario name. |
-cctestid | -cctid | Code 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 | -cctype | Specifies 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 | -ccclear | Specifies 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 | -etws | Specifies 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. |
Tip
-jcl
and -jcldsn
cannot both be used in the same statement. Specify either -jcl
or -jcldsn
.
Test Runner optional parameters
Parameter/Option | Abbr. | Description |
---|---|---|
-dsnhlq | -hlq | High level qualifier to be used when allocating data sets. |
-wait | -w | Indicates if component waits for test completion. Must be TRUE or FALSE. The default is TRUE. |
-maxwait | -mw | The number of minutes to wait for the test to complete. The default is 20 minutes. |
-useStubs | -us | Indicates if the test should use stubs. Must be TRUE or FALSE. The default is TRUE. |
-backuparchive | -ba | Indicates 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 | -dt | Indicates 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
Parameter | Abbr. | 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 | -te | The character encoding (charset) used on the target platform. Default is '1047'. |
Output parameters
Parameter | Abbr. | Description |
---|---|---|
-archive | -a | The archive created containing all test data. See Optional Parameters for more information. |
-binput | -bin | The binary input data file. See Optional Parameters for more information. |
-binref | -brf | The binary reference file. See Optional Parameters for more information. |
Optional output parameters
Parameter | Abbr. | 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.
Parameter | Abbr. | Description |
---|---|---|
-command | -cmd | The command to be executed. Must be either 'upload' or 'download'. |
File Transfer common parameters
Parameter | Abbr. | Description |
---|---|---|
-host | -h | The host name or IP address of the target host. |
-port | -pt | The port the host is listening on. |
-user | -u | The name of the user (userID) to connect to the host with. |
-password | -pw | The password associated with the userID. |
-targetencoding | -te | The character encoding (charset) used on the target platform. Default is '1047'. |
File Transfer upload parameters
Parameter | Abbr. | Description |
---|---|---|
-bininp | -bin | The binary input data file produced by the builder. |
-binref | -brf | The binary reference file produced by the builder. |
-dsnhlq | -hlq | Optional high level qualifier to be used when allocating data sets. |
File Transfer download parameters
Parameter | Abbr. | Description |
---|---|---|
-binres | -brs | The binary result file to be written to. |
-binresdsn | -brsdsn | The 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
Parameter | Abbr. | Description |
---|---|---|
-host | -h | The host name or IP address of the target host. |
-port | -pt | The port the host is listening on. |
-user | -u | The name of the user (userID) to connect to the host with. |
-password | -pw | The password associated with the userID. |
-targetencoding | -te | The character encoding (charset) used on the target platform. The default is �1047�. |
-bininpdsn | -bindsn | The BININP dataset name on the target host, to use for the test run. This is only required if the JCL requires substitution. |
-binrefdsn | -brfdsn | The BINREF dataset name on the target host, to use for the test run. This is only required if the JCL requires substitution. |
-binresdsn | -brsdsn | The BINRES dataset name on the target host, to use for the test run. This is only required if the JCL requires substitution. |
-ccrepository | -ccrepo | The name of the Code Coverage repository dataset. Must be specified to enable Code Coverage. |
-ccsystem | -ccsys | Code Coverage system. If not specified with '-ccrepo', defaults to the test suite or test scenario name. |
-cctestid | -cctid | Code 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 | -cctype | Specifies 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 | -ccclear | Specifies 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
Parameter | Abbr. | Description |
---|---|---|
-jcl | -j | The file name containing the JCL to submit. |
JCL submit parameter from z/OS data set
Parameter | Abbr. | Description |
---|---|---|
-jcldsn | -jdsn | The 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
Parameter | Abbr. | Description |
---|---|---|
-wait | -w | Indicates if component waits for test completion. Must be true or false. Defaults to true. |
-maxwait | -mw | The 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
Parameter | Abbr. | Description |
---|---|---|
-binres | -brs | The binary result data file which was the output of the test execution on the target platform. |
-targetencoding | -te | The 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
Parameter | Abbr. | Description |
---|---|---|
-archive | -a | The archive from the Parser which will be updated (unless the output parameter is used, see below). |
Result Checker optional input parameters
Parameter | Abbr. | Description |
---|---|---|
-targetencoding | -te | The character encoding (charset) used on the target platform. Defaults to the encoding stored in the archive. |
Result Checker output parameters
Parameter | Abbr. | Description |
---|---|---|
-result | -rs | The 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 | -rp | The name of the HTML result report to be created. (Not required when project parameter is provided.) |
-junit | -ju | The 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 | -so | The 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 | -etws | Specifies 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
Parameter | Abbr. | Description |
---|---|---|
-outputarchive | -oar | A new archive to be created instead of updating the input archive. Default is to update the input archive. |
-project | -p | Path 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 | -fe | The character encoding to be used for output files. Defaults to UTF-8. |
-save | -s | Save 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. |
Comments
Log in or register to comment.