Overview

The JMS CTS can be configured with filters to restrict which tests are run and which are not. This is useful to:

  • Help locate problems in a JMS implementation
  • Exclude tests that invoke features not supported by an implementation.

Creating a filter

A filter is a simple XML file, containing elements that indicate the tests to include or exclude. Filters can be set for the following:

  • Connection factory type
  • Session acknowledgement type
  • Destination type
  • Message delivery mode
  • Synchronous or asynchronous message consumers
  • Message type
  • Test cases

The following example excludes all test cases that use XAQueueConnectionFactory and XATopicConnectionFactory.

<filter>
  <exclude>
    <factory>XAQueueConnectionFactory</factory>
  </exclude>
  <exclude>
    <factory>XATopicConnectionFactory</factory>
  </exclude>
</filter>
        

This could also have been written as:

<filter>
  <include>
    <factory>QueueConnectionFactory</factory>
  </include>
  <include>
    <factory>TopicConnectionFactory</factory>
  </include>
</filter>
        

Combining filters

Test cases can be filtered on more than one criteria. The following example exc ludes all tests using NON_PERSISTENT message delivery mode, and administered destinations.

<filter>
  <exclude>
    <destination>administered</destination>
    <deliveryMode>NON_PERSISTENT</deliveryMode>
  </exclude>
</filter>
        

Note: the above does not exclude test cases using administered destinations and PERSISTENT delivery mode.

Using a filter

To run the JMS CTS with a filter, specify the -filter argument. E.g:

Windows

> jmscts.bat run -filter filter.xml
        

Unix

> jmscts.sh run -filter filter.xml
        

Filter elements

The following elements may be set in an < include > or < exclude > filter:

  • factory

    The < factory > element specifies the type of connection factory (i.e. javax.jms.ConnectionFactory) to filter. Valid values for this element are:

    • QueueConnectionFactory
    • TopicConnectionFactory
    • XAQueueConnectionFactory
    • XATopicConnectionFactory
    Eg:
    <filter>
      <exclude>
        <factory>TopicConnectionFactory</factory>
      </exclude>
    </filter>
                  

  • session

    The < session > element specifies t he type of session message acknowledgement behaviour to filter. Valid values for this element are:

    • TRANSACTED
    • AUTO_ACKNOWLEDGE
    • DUPS_OK_ACKNOWLEDGE
    • CLIENT_ACKNOWLEDGE

  • destination

    The < destination > element specifies the type of destination to filter. Valid values for this element are:

    • administered
    • temporary

  • deliveryMode

    The < deliveryMode > element specifies the type of message delivery mode to filter (as specified by javax.jms.DeliveryMode). Valid values for this element are:

    • PERSISTENT
    • NON_PERSISTENT

  • receiver

    The < receiver > element specifies the type of message receiver to filter. Valid values for this element are:

    • asynchronous - specifies asynchonous message receipt
    • synchronous - specifies synchronous message receipt
    • asynchronous_durable - specifies asynchronous message receipt by durable topic subscribers
    • synchronous_durable - specifies synchronous message receipt by durable topic subscribers
    • browser - speci fies queue browser receipt

  • message

    The < message > element specifies the type of message (i.e. javax.jms.Message) to filter. Valid values for this element are:

    • BytesMessage
    • MapMessage
    • ObjectMessage
    • StreamMessage
    • TextMessage

  • test

    The < test > element specifies a fully qualified test case name, without any brackets.