Enabling recording and stubbing in the CICS Transaction Gateway daemon

As an alternative to a CICS® Transaction Gateway client application, you can use the CICS Transaction Gateway daemon for recording and stubbing.

About this task

Before you can use CICS Transaction Gateway to record or stub, make sure of these things:

  • HCL Quality Server, which is included in HCL OneTest™ Virtualization product offering, must be installed and configured. For information about installing HCL Quality Server, refer to Installing HCL OneTest Virtualization.
  • The class path of the CICS Transaction Gateway daemon must be edited to include the HCL OneTest API CICS TG Recording JAR file.

Procedure

  1. Download and extract the CICS Transaction Gateway exits package, IBMCICSTransactionGateway.zip, that is provided with HCL Quality Server into a location. For information about the package, see HCL OneTest API tool packages
  2. Copy the HCL OneTest API CICS TG Recording JAR file and supporting files to the system that is running the CICS Transaction Gateway daemon. The files are as follows:
    • com.ibm.rational.rit.ctg.jar
    • registration.xml
  3. Edit the registration.xml file as follows:
    1. Ensure that the server base-url setting specifies the HCL Quality Server instance that you want to use.
    2. Uncomment and edit the identifier name setting.

      This setting enables you to specify a name for this proxy. Assigning a name to a proxy makes it easier to identify the proxy when there are two or more proxies of the same type registered with HCL Quality Server.

    3. Set the statistics initial state in the file.
      • Setting statistics initial-state to on sets the Observation level for this intercept in HCL Quality Server to Statistics when the intercept first registers with HCL Quality Server.
      • Setting statistics initial-state to off sets the Observation level for this intercept to None when the intercept first registers.
  4. Configure the CICS TG Daemon to include the HCL OneTest API CICS TG recording JAR file. You must specify both the classpath and request monitoring exit classname. Start the CICS TG Daemon by using one of the ctgservice, stgstart, or ctgd commands as appropriate. The steps you follow are slightly different for Windows and non-Windows computers.
    • On Windows computers, the CICS Transaction Gateway typically runs as a service. To add parameters to the service, use the ctgservice.exe program that is typically found in the bin folder of the CTG installation; for example, C:\Program Files (x86)\IBM\CICS Transaction Gateway\bin. To verify the parameters, open the Windows registry and check the entry for the service. Typically, it is at
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\IBMCICSTransactionGateway\Parameters
      .
    • On non-Windows computers, use the parameters with the ctgstart program that is typically found in the bin folder of the CTG installation; for example, /opt/ibm/cicstg/bin.

      Following is an example:
      ./ctgstart -classpath=/opt/ibm/cicstg/classes/com.ibm.rational.rit.ctg.jar -j-Dgreenhat.logappender.console.CONSOLE=layout:detailed
    To enable the monitoring and intercepts exit, run the CTG Configuration Tool by adding the following classnames: com.ibm.rational.rit.CTGRecordingExit and com.ibm.rational.rit.CTGDaemonIntercept.

    CICS Exit classnames

    CICS Exit classnames

    This action updates the ctg.ini file as follows:
    requestexits=com.ibm.rational.rit.CTGRecordingExit 
    cicsintercept=com.ibm.rational.rit.CTGDaemonIntercept
  5. Optional: To customize the run-time environment, use the ctgservice.exe program. In the following example, the JAR file is added to the classpath and logging is enabled (in debug mode) for the exit:
    ctgservice.exe -R -A-classpath="C:\Program Files (x86)\IBM\CICS Transaction Gateway\classes\com.ibm.rational.rit.ctg.jar" -A-j-Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG
    The following text block shows a sample output:
    C:\Program Files (x86)\IBM\CICS Transaction Gateway\bin>ctgservice.exe -R 
    -A-classpath="c:\Program Files (x86)\IBM\CICS Transaction Gateway\classes\com.ibm.rational.rit.ctg.jar" 
    -A-j-Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG
    CTG9512I CTGSERVICE - CICS Transaction Gateway Windows Service Utility
    CTG9513I (C) Copyright IBM Corporation 2009, 2016.  All rights reserved.
    CTG9518I Gateway daemon parameter overrides are:
    -A-classpath=c:\Program Files (x86)\IBM\CICS Transaction Gateway\classes\com.
    ibm.rational.rit.ctg.jar
    -A-j-Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG
    For more details about ctgservice.exe, ctgservice command reference.
    Note: Adding the JAR file and registration.xml to the CTG classes folder does not automatically enable the proxy code. You must explicitly add the JAR file to the classpath.

    For information on setting the classpath to point to the com.ibm.rational.rit.ctg.jar file, see CICS TG Command reference. For information on how to configure the request monitoring exit classname com.ibm.rational.rit.CTGRecordingExit, see Configuring request monitoring exits for the Gateway daemon.

Configuring the Exit on non-Windows computers

For non-Windows computers, the CICS Transaction Gateway Exit installer is a single executable.

Before you begin

  • The Korn shell (32-bit application)
  • KSH and required libraries added to the operating system including their 32-bit versions
To find the package, run a search. For example:
# yum search curses
…
ncurses-libs.i686 : Ncurses libraries
ncurses-libs.x86_64 : Ncurses libraries

About this task

On a 64-bit operating system, yum install ncurses-libs installs the 64-bit version only. Run yum install ncurses-libs.i686 to add the 32-bit version.

The default location of the installation is /opt/ibm/cicstg. The configuration and logging files are by default located at /var/cicscli.

Procedure

  1. In the CICS Transaction Gateway Exit Configuration tool, enable the monitoring and intercept exits as outlined in the previous procedure (for Windows).
  2. To start the CICS Transaction Gateway Exit, run the following command in the bin folder:
    ./ctgstart -classpath=/opt/ibm/cicstg/classes/com.ibm.rational.rit.ctg.jar -j-Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG

    For more details about ctgstart, ctgstart command reference.

Feedback