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 IBM® Rational® Test Control Panel, which is included in either Rational® Test Workbench or IBM® Rational® Test Virtualization Server product offering. For information about installing Rational® Test Control Panel, refer to Installing Rational Test Workbench or Installing Rational Test Virtualization Server.
  • Edited the class path of the CICS® Transaction Gateway daemon to include the Rational® Integration Tester CICS TG Recording JAR file.

Procedure

  1. Download and extract the CICS® Transaction Gateway exits package, IBMCICSTransactionGateway.zip, that is provided with Rational® Test Control Panel into a location.
  2. Copy the Rational® Integration Tester 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 Rational® Test Control Panel 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 Rational® Test Control Panel.

    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 Rational® Test Control Panel to Statistics when the intercept first registers with Rational® Test Control Panel.

      Off

      Sets the Observation level for the intercept to None when the intercept first registers with Rational® Test Control Panel.

  4. Configure the CICS TG Daemon to include the Rational® Integration Tester 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
    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.