Recording JMS by using Subscribe/Browse

If you are testing a Java™ application that uses the Java Message Service (JMS) interface, you can use HCL OneTest™ API to record publication operations.

About this task

In Recording Studio, you can save the recorded events as a test, stub, or other project resource by using the Recorded Events wizard.

Generic JMS topics can be recorded by using the topic that is configured within the operation.

TIBCO EMS queues are the only JMS queues that can be recorded. If you attempt to record any other JMS queues, an error message is displayed:
Unable to monitor reply destination as it appears to be a queue implementation that cannot be non-destructively read from. Consider using the java agent to enable this interaction to be recorded.
For TIBCO EMS, if security is enabled on the EMS server, a valid JNDI user name and password are required (in the configuration of the physical TIBCO EMS Broker) to monitor events. For more information see Recording WebSphere MQ and TIBCO EMS Server events.

For an alternative method of recording these types of queues, see Recording JMS by using the Client Agent.

Procedure

  1. Prepare HCL OneTest API
    1. In Library Manager, ensure that the Java client libraries from the JMS provider are configured correctly. By completing these steps HCL OneTest API can communicate with a physical JMS server.
    2. In the Architecture School perspective, open the Logical view and then create a JMS topic, queue or destination domain, as appropriate.
    3. Create an operation and bind it to the JMS domain transport. Specify the queue or topic under JMS Headers in Message Exchange Pattern on the operation as defined in the Logical View of Architecture School.
    4. In the Physical View of the Architecture School, create a physical JMS Broker.
    5. Bind the logical and physical resources in a new or current environment. For more information, see Creating a Java Message Service (JMS) broker.
    6. While you are still in the Physical View, configure the JMS transport. For more information, see Recording and stubbing settings. For the recording mode, select Subscribe/Browse.
    7. Import schemas so that HCL OneTest API can apply them to the recorded messages. For information on adding schema for JMS Java object messages, see Adding Java object schemas. A schema is not required for a JMS Map message, as it has a known format.
  2. Record the application
    1. In HCL OneTest API, open the Recording Studio perspective.
    2. Create a recording monitor for the operation associated with the logical JMS domain.
    3. Start a recording session: from the toolbar of the Events View window, click the Start Recording (Start Recording) icon.
    4. Wait for recorded events. Depending on the Java application that you are testing, you might have to use the application to generate events.
    5. Stop the recording session: from the toolbar of the Events View window, click the Pause recording (Pause recording) icon.
Feedback