Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2024.1

...

The Settings tab contains the following:

  • If you created a Shared Property for JMS Connections, a menu will be available from which you can choose Use Local Settings or Use Shared Property.
    • If you select Use Shared Property, a second menu displays from which you select the desired global JMS settings that the tool will use. For more information on global JMS settings, see Adding Global Test Suite Properties.
    • If you select Use Local Settings, or if no shared property is specified, you can configure the rest of the options for Connection Settings.
  • Provider URL: Specifies the value of the property named javax.naming.Context.PROVIDER_URL passed to the JNDI javax.naming.InitialContext constructor.
  • Initial Context: Specifies a fully qualified class name string, passed to the JNDI javax.naming.InitialContext constructor as a string value for the property named javax.naming.Context.INITIAL_CONTEXT_FACTORY.
  • Connection Factory: Specifies the JNDI name for the factory. This is passed to the lookup() method in javax.naming.InitialContext to create a javax.jms.QueueConnectionFactory or a javax.jms.TopicConnectionFactory instance.

In addition to the Settings tab, the Connection Settings also include:

  • Queue Connection Authentication: Allows users to provide a username and password to create a queue connection. Enable Perform Authentication and enter the Username and Password to authenticate the request. If the correct username and password are not used, the request will not be authenticated. The username and password provided here is passed to the createQueueConnection() method in the javax.jms.QueueConnectionFactory class in order to get an instance of javax.jms.QueueConnection.
  • Keep-Alive Connection: Select to notify the test whether to share or close the current connection. The shared connections are returned to the connection pool to be used across the test suite. A life cycle of a connection pool is as follows:
    • For a single test, it is destroyed at the end of the test execution.
    • For a test suite, it is destroyed at the end of the test suite execution.
    • For a load test, it is destroyed at the end of the load testing.

...

The Queue/Topic settings contain the following options:

  • JMS Destination: Specifies the queue name (if point to point is used) or topic name (if publish and subscribe is used) to which the message will be sent.
  • JMS ReplyTo: Specifies the queue name (if point to point is used) or topic name (if publish and subscribe is used) from which to get a response message. This can be a temporary queue if Temporary is selected instead of Form.

...

Messaging Model options specify how messages are sent between applications. Select either Point to Point or Publish and Subscribe.

...

The Messaging Expiration option specifies the message expiration time (in milliseconds).

...

  • Provider URL: Specifies the value of the property named javax.naming.Context.PROVIDER_URL passed to the JNDI javax.naming.InitialContext constructor.
  • Initial Context: Specifies a fully qualified class name string, passed to the JNDI javax.naming.InitialContext constructor as a string value for the property named javax.naming.Context.INITIAL_CONTEXT_FACTORY.
  • Connection Factory: Specifies the JNDI name for the factory. This is passed to the lookup() method in javax.naming.InitialContext to create a javax.jms.QueueConnectionFactory or a javax.jms.TopicConnectionFactory instance.

In addition to the Settings tab, the Connection Settings also include:

  • Queue Connection Authentication: Allows users to provide a username and password to create a queue connection. Enable Perform Authentication and enter the Username and Password to authenticate the request. If the correct username and password are not used, the request will not be authenticated. The username and password provided here is passed to the createQueueConnection() method in the javax.jms.QueueConnectionFactory class in order to get an instance of javax.jms.QueueConnection.

Anchor
jms_queue_topic
jms_queue_topic
Queue/Topic

The Queue/Topic settings contain the following options:

  • JMS Destination: Specifies the queue name (if point to point is used) or topic name (if publish and subscribe is used) to which the message will be sent.
  • JMS ReplyTo: Specifies the queue name (if point to point is used) or topic name (if publish and subscribe is used) from which to get a response message. This can be a temporary queue if Temporary is selected instead of Form.

Anchor
jms_messaging_model
jms_messaging_model
Messaging Model

Messaging Model options specify how messages are sent between applications. Select either Point to Point or Publish and Subscribe.

Anchor
jms_messaging_expiration
jms_messaging_expiration
Messaging Expiration

The Messaging Expiration option specifies the message expiration time (in milliseconds).

Anchor
jms_message_exchange_pattern
jms_message_exchange_pattern
Message Exchange Pattern

Message Exchange Pattern options specify whether or not SOAtest or Virtualize receives a response. If Get Response is selected, SOAtest or Virtualize sends a message and receives a response. If Get Response is not selected, SOAtest or Virtualize sends a one-way message and does not receive a response.

If Get Response is selected, you can also enable Create message consumer on the JMSReplyTo destination before sending the message. If the response is expected to become available very quickly on the JMSReplyTo topic, this option should be enabled to ensure that SOAtest or Virtualize has subscribed to the reply topic before the response message is published.

This option cannot be mixed with Match response JMSCorrelationID with the request JMSMEssageID because the JMS specification requires vendors to generate the JMSMessageID after the message is sent. As a result, there is no way to create the consumer on the response destination with that correlation (selector) set until after the message has been set and the JMSMessageID becomes available. 

Anchor
jms_message_type
jms_message_type
Message Type

Message Type options allow you to select the message type from the menu. A JMS Message is a Java object that contains the data being transferred between JMS clients. The following Message Types are available:

  • TextMessage: Used to send a message containing a java.lang.String. It is useful if you want only to send a simple text document. If you are doing SOAP over JMS, the String you enter into the TextMessage should be the SOAP Envelope.
  • BytesMessage: Used to send a message containing a stream of uninterpreted bytes. The receiver of the message interprets the bytes as it sees fit. If you are doing SOAP over JMS, the bytes you enter into the ByteMessage should compose the SOAP Envelope. Data is sent in its most basic representation. It may also be useful when the JMS node is only interested in forwarding/routing data so the contents of the data aren't important to them. It is one of the most commonly used along with TextMessage.
    • When the encoding in the Parasoft preferences is UTF-8 (the default), you can use the Method options to control how a string is extracted from response BytesMessages. The two methods in the menu correspond to the two methods available in BytesMessage JMS API (see the Oracle Java documentation for details).
    • If a different encoding is selected in the preferences, SOAtest or Virtualize will always invoke BytesMessage.readBytes() on the response messages in order to account for different character encodings.
  • StreamMessage: Used to send a stream of primitive values

...

Message Exchange Pattern options specify whether or not SOAtest or Virtualize receives a response. If Get Response is selected, SOAtest or Virtualize sends a message and receives a response. If Get Response is not selected, SOAtest or Virtualize sends a one-way message and does not receive a response.

If Get Response is selected, you can also enable Create message consumer on the JMSReplyTo destination before sending the message. If the response is expected to become available very quickly on the JMSReplyTo topic, this option should be enabled to ensure that SOAtest or Virtualize has subscribed to the reply topic before the response message is published.

This option cannot be mixed with Match response JMSCorrelationID with the request JMSMEssageID because the JMS specification requires vendors to generate the JMSMessageID after the message is sent. As a result, there is no way to create the consumer on the response destination with that correlation (selector) set until after the message has been set and the JMSMessageID becomes available. 

...

Message Type options allow you to select the message type from the menu. A JMS Message is a Java object that contains the data being transferred between JMS clients. The following Message Types are available:

  • TextMessage: Used to send a message containing a java.lang.String. It is useful if you want only to send a simple text document. If you are doing SOAP over JMS, the String you enter into the TextMessage should be the SOAP Envelope.
  • BytesMessage: Used to send a message containing a stream of uninterpreted bytes. The receiver of the message interprets the bytes as it sees fit. If you are doing SOAP over JMS, the bytes Stream you enter into the ByteMessage StreamMessage should compose of the SOAP Envelope. Data is sent in its most basic representation. It may also be useful when the JMS node is only interested in forwarding/routing data so the contents of the data aren't important to them. It is one of the most commonly used along with TextMessage.
    • When the encoding in the Parasoft preferences is UTF-8 (the default), you can use the Method options to control how a string is extracted from response BytesMessages. The two methods in the menu correspond to the two methods available in BytesMessage JMS API (see the Oracle Java documentation for details).
    • If a different encoding is selected in the preferences, SOAtest or Virtualize will always invoke BytesMessage.readBytes() on the response messages in order to account for different character encodings.
  • StreamMessage: Used to send a stream of primitive values. If you are doing SOAP over JMS, the Stream you enter into the StreamMessage should of the SOAP Envelope.
  • ObjectMessage: Used to send a Java Serializable. You should use the Scripting input view to return a Java Serializable. This object will be taken and stuck into the ObjectMessage during runtime.
  • MapMessage: Used to send a set of name-value pairs. The values can only be java primitives or their respective wrappers, Strings, or byte arrays. One intricacy of MapMessage objects is that even though you inserted a value as a String (using setString()), if the value can be coerced into an integer we can call getInt() and get a value of type integer.

...

The Request Message Properties are optional and allows for any miscellaneous property values to be set into the javax.jms.Message object before it gets sent to a queue or published to a topic. These include predefined properties that get set to the outgoing requests message using one of the corresponding "set" methods in javax.jms.Message, or custom properties (for example, properties set with setStringProperty, setBooleanProperty, setByteProperty, and so on)

Property values, which can be added by clicking Add and completing the Add JMS Property dialog, can be set to a fixed value, a parameterized value, a scripted value, or a unique value (an automatically generated random unique value; no two tool invocations will use the same value). Be sure to specify the type for each added value.

Image Removed

...

The Response Message Correlation settings contain the following options:

  • Match response JMSCorrelationID with request JMSMessageID: If selected, the term JMSCorrelationID = '[msgId]' will be appended to the selector expression, where msgId is dynamically generated from the outgoing (request) javax.jms.Message (using the getJMSMessageID() method). Effectively, this results in the tool blocking until a message with the specified correlation id becomes available in the queue (or topic) and it will only retrieve that particular message, rather than retrieving any message in the queue (or topic). The tool will timeout after the timeout amount elapses and if there is no message that watches the selector criteria.
  • Match response JMSCorrelationID with request JMSCorrelationID: If selected, the term JMSCorrelationID = '[correlationId]' will be appended to the selector expression, where correlationId is retrieved from JMSCorrelationID property in the Message Properties section. The option becomes enabled only if such property is added to the Message Properties section. Effectively, this results in the tool blocking until a message with the specified correlation id becomes available in the queue (or topic) and it will only retrieve that particular message, rather than retrieving any message in the queue (or topic). The tool will timeout after the timeout amount elapses and if there is no message that watches the selector criteria.
  • Additional Selector Expression Terms: (Optional) Enter a value to act as a message filter. For example, by entering username==John, only messages that contain "John" as a username will be delivered. If this field is left blank, then any messages can be received from the queue.
    This expression is passed to the createReceiver() method of the javax.jms.QueueSession class in point-to-point messaging, or the createSubscriber() method of the javax.jms.TopicSession class in publish and subscribe messaging. For tips on specifying a selector, see Using Message Selector Filters.

Message Object Outputs for Clients Using JMS

You can add message object outputs to Messaging Clients that use the JMS transport. You can also add incoming JMS message outputs to Call Back tools that use the JMS transport. You can chain an Extension tool, for example, to a Messaging Client that uses JMS so that it has access to the response JMS Message. In the ObjectMessage case, you can use getter and equals() methods to validate the response thereby creating a regression control. In addition, you can chain a Diff tool to the Response Traffic and if the response is an ObjectMessage, SOAtest will convert the inserted serializable object to XML format and perform an XML diff. By doing this you can use data bank values, ignore XPath differences, etc.

To do this complete the following:

  1. Right-click the Messaging Client or Call Back tool node and choose Add Output. The Add Output wizard opens.
    Image Removed
  2. Choose Response > Message Object (or Incoming Request > Incoming JMS Message for Call Back tools) in the left pane. 
  3. Choose New Output or Existing Output and the desired tool (for example, an Extension tool) from the right pane.
  4. Click Finish. SOAtest adds the new output to the selected node.

...

See JMS Provider Configuration

Responding to a Temporary JMSReplyTo Queue

To respond to a JMS message with a temporary queue set in the JMSReplyTo field:

...

This key is defined within the SOAtest Extensibility API under SOAPUtil.JMS_MSG_KEY. To access the SOAtest Extensibility API, go to Help > Help Contents or Parasoft> Help (depending on your installation), then look for the book titled "Parasoft SOAtest Extensibility API".

...

  • SOAPUtil.JMS_CONTEXT_QUEUE, which is another keyword defined in the SOAtest Extensibility API, should be used as the JMSDestination of this tool.
  • ObjectMessage: Used to send a Java Serializable. You should use the Scripting input view to return a Java Serializable. This object will be taken and stuck into the ObjectMessage during runtime.
  • MapMessage: Used to send a set of name-value pairs. The values can only be java primitives or their respective wrappers, Strings, or byte arrays. One intricacy of MapMessage objects is that even though you inserted a value as a String (using setString()), if the value can be coerced into an integer we can call getInt() and get a value of type integer.

Anchor
jms_request_message_properties
jms_request_message_properties
Request Message Properties

The Request Message Properties are optional and allows for any miscellaneous property values to be set into the javax.jms.Message object before it gets sent to a queue or published to a topic. These include predefined properties that get set to the outgoing requests message using one of the corresponding "set" methods in javax.jms.Message, or custom properties (for example, properties set with setStringProperty, setBooleanProperty, setByteProperty, and so on)

Property values, which can be added by clicking Add and completing the Add JMS Property dialog, can be set to a fixed value, a parameterized value, a scripted value, or a unique value (an automatically generated random unique value; no two tool invocations will use the same value). Be sure to specify the type for each added value.

Image Added

Anchor
jms_response_message_correlation
jms_response_message_correlation
Response Message Correlation

The Response Message Correlation settings contain the following options:

  • Match response JMSCorrelationID with request JMSMessageID: If selected, the term JMSCorrelationID = '[msgId]' will be appended to the selector expression, where msgId is dynamically generated from the outgoing (request) javax.jms.Message (using the getJMSMessageID() method). Effectively, this results in the tool blocking until a message with the specified correlation id becomes available in the queue (or topic) and it will only retrieve that particular message, rather than retrieving any message in the queue (or topic). The tool will timeout after the timeout amount elapses and if there is no message that watches the selector criteria.
  • Match response JMSCorrelationID with request JMSCorrelationID: If selected, the term JMSCorrelationID = '[correlationId]' will be appended to the selector expression, where correlationId is retrieved from JMSCorrelationID property in the Message Properties section. The option becomes enabled only if such property is added to the Message Properties section. Effectively, this results in the tool blocking until a message with the specified correlation id becomes available in the queue (or topic) and it will only retrieve that particular message, rather than retrieving any message in the queue (or topic). The tool will timeout after the timeout amount elapses and if there is no message that watches the selector criteria.
  • Additional Selector Expression Terms: (Optional) Enter a value to act as a message filter. For example, by entering username==John, only messages that contain "John" as a username will be delivered. If this field is left blank, then any messages can be received from the queue.
    This expression is passed to the createReceiver() method of the javax.jms.QueueSession class in point-to-point messaging, or the createSubscriber() method of the javax.jms.TopicSession class in publish and subscribe messaging. For tips on specifying a selector, see Using Message Selector Filters.

Anchor
jms_provider_configuration
jms_provider_configuration
Configuration for Popular JMS Providers

See JMS Provider ConfigurationSOAtest will then use the temporary queue of the received message as the destination in place of the keyword entered as the destination.

Anchor
jms_message_selector_filters
jms_message_selector_filters
Using Message Selector Filters

...

The Queue Browser allows you to see the contents of queues deployed on IBM MQ, Websphere Application Server, Tibco EMS, Sonic MQ, ActiveMQ, and any other JMS provider. See Browsing Queues in SOAtest and Browsing Queues in Virtualize for details.