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.

Before you begin

About this task

Before you can use CICS® Transaction Gateway to record or stub, you must have completed the following tasks:
  • Installed and configured HCL Quality Server, which is included in HCL OneTest Virtualization product offering. For information about installing HCL Quality Server, refer to Installing HCL OneTest Virtualization.
  • Edited the class path of the CICS® Transaction Gateway daemon 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.
  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 and perform the following changes:
    1. Specify the HCL Quality Server instance that you want to use in the server base-url setting.
    2. Uncomment and edit the identifier name setting by specfying a name for the 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 attribute based on the following description of the options.
      Option Description

      On

      Sets the Observation level for the intercept in HCL Quality Server to Statistics when the intercept first registers with HCL Quality Server.

      Off

      Sets the Observation level for the intercept to None when the intercept first registers with HCL Quality Server.

  4. Configure the CICS TG Daemon to include the HCL OneTest API CICS TG recording JAR file by specifying the classpath and request monitoring exit classname parameters. Complete the following steps:
    1. Start the CICS TG Daemon by using any of the following commands that depends on whether you are using a Windows and non-Windows computer:
      • ctgservice
      • ctgstart
      • ctgd
      On Windows computers, the CICS Transaction Gateway runs as a service. To add parameters to the service, use the ctgservice.exe program that is 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. It can be at
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\IBMCICSTransactionGateway\Parameters
      .

      On non-Windows computers, use the parameters with the ctgstart program that can be 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

    The steps you follow are slightly different for s.
    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

    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.