org.mule.test.integration.providers.jms.tools
Class JmsTestUtils

java.lang.Object
  extended by org.mule.test.integration.providers.jms.tools.JmsTestUtils

public class JmsTestUtils
extends Object

JmsTestUtils contains some helper code necessary to test interaction with different JMS providers.


Field Summary
static String ACTIVE_MQ_JMS_PROPERTIES
           
static String DEFAULT_JNDI_CONECTION_NAME_PROPERTY
           
static String JMS_PROPERTIES
           
static String JMS_PROPERTIES_PROPERTY
           
static String JNDI_QUEUE_CONECTION_NAME_PROPERTY
           
static String JNDI_TOPIC_CONECTION_NAME_PROPERTY
           
static String JNDI_XAQUEUE_CONECTION_NAME_PROPERTY
           
static String JNDI_XATOPIC_CONECTION_NAME_PROPERTY
           
static String JORAM_JMS_PROPERTIES
           
static String OPEN_JMS_PROPERTIES
           
static String SPIRIT_WAVE_JMS_PROPERTIES
           
static String UBERMQ_JMS_PROPERTIES
           
 
Constructor Summary
JmsTestUtils()
           
 
Method Summary
static void drainQueue(QueueConnection cnn, String queue)
           
static void drainTopic(TopicConnection cnn, String topic)
           
static void fixProviderUrl(Properties props)
           
static Properties getJmsProperties()
           
static Properties getJmsProperties(String propertyFile)
           
static QueueConnection getQueueConnection()
           
static QueueConnection getQueueConnection(Properties props)
           
static QueueReceiver getQueueReceiver(QueueConnection cnn, String queueName)
           
static Session getSession(Connection cnn)
           
static TextMessage getTextMessage(Connection cnn, String message)
           
static TopicConnection getTopicConnection()
           
static TopicConnection getTopicConnection(Properties props)
           
static TopicSubscriber getTopicSubscriber(TopicConnection cnn, String topicName)
           
static XAQueueConnection getXAQueueConnection()
           
static XAQueueConnection getXAQueueConnection(Properties props)
           
static XASession getXASession(XAConnection cnn)
           
static XATopicConnection getXATopicConnection()
           
static Object lookupObject(Context context, String reference)
           
static Message queueReceiver(QueueConnection cnn, String queueName, long timeout)
           
static void queueSend(QueueConnection cnn, String queueName, String payload, boolean transacted, int ack, String replyTo)
           
static void topicPublish(TopicConnection cnn, String topicName, String payload, boolean transacted, int ack)
           
static void topicPublish(TopicConnection cnn, String topicName, String payload, boolean transacted, int ack, String replyTo)
           
static Message topicSubscribe(TopicConnection cnn, String topicName, long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UBERMQ_JMS_PROPERTIES

public static final String UBERMQ_JMS_PROPERTIES
See Also:
Constant Field Values

OPEN_JMS_PROPERTIES

public static final String OPEN_JMS_PROPERTIES
See Also:
Constant Field Values

JORAM_JMS_PROPERTIES

public static final String JORAM_JMS_PROPERTIES
See Also:
Constant Field Values

SPIRIT_WAVE_JMS_PROPERTIES

public static final String SPIRIT_WAVE_JMS_PROPERTIES
See Also:
Constant Field Values

ACTIVE_MQ_JMS_PROPERTIES

public static final String ACTIVE_MQ_JMS_PROPERTIES
See Also:
Constant Field Values

JMS_PROPERTIES

public static final String JMS_PROPERTIES
See Also:
Constant Field Values

JMS_PROPERTIES_PROPERTY

public static final String JMS_PROPERTIES_PROPERTY
See Also:
Constant Field Values

DEFAULT_JNDI_CONECTION_NAME_PROPERTY

public static final String DEFAULT_JNDI_CONECTION_NAME_PROPERTY
See Also:
Constant Field Values

JNDI_QUEUE_CONECTION_NAME_PROPERTY

public static final String JNDI_QUEUE_CONECTION_NAME_PROPERTY
See Also:
Constant Field Values

JNDI_TOPIC_CONECTION_NAME_PROPERTY

public static final String JNDI_TOPIC_CONECTION_NAME_PROPERTY
See Also:
Constant Field Values

JNDI_XAQUEUE_CONECTION_NAME_PROPERTY

public static final String JNDI_XAQUEUE_CONECTION_NAME_PROPERTY
See Also:
Constant Field Values

JNDI_XATOPIC_CONECTION_NAME_PROPERTY

public static final String JNDI_XATOPIC_CONECTION_NAME_PROPERTY
See Also:
Constant Field Values
Constructor Detail

JmsTestUtils

public JmsTestUtils()
Method Detail

getJmsProperties

public static Properties getJmsProperties()
                                   throws IOException
Throws:
IOException

getJmsProperties

public static Properties getJmsProperties(String propertyFile)
                                   throws IOException
Throws:
IOException

fixProviderUrl

public static void fixProviderUrl(Properties props)
                           throws IOException
Throws:
IOException

getQueueConnection

public static QueueConnection getQueueConnection()
                                          throws IOException,
                                                 NamingException,
                                                 JMSException
Throws:
IOException
NamingException
JMSException

getXAQueueConnection

public static XAQueueConnection getXAQueueConnection()
                                              throws IOException,
                                                     NamingException,
                                                     JMSException
Throws:
IOException
NamingException
JMSException

getXAQueueConnection

public static XAQueueConnection getXAQueueConnection(Properties props)
                                              throws IOException,
                                                     NamingException,
                                                     JMSException
Throws:
IOException
NamingException
JMSException

getQueueConnection

public static QueueConnection getQueueConnection(Properties props)
                                          throws IOException,
                                                 NamingException,
                                                 JMSException
Throws:
IOException
NamingException
JMSException

getTopicConnection

public static TopicConnection getTopicConnection()
                                          throws IOException,
                                                 NamingException,
                                                 JMSException
Throws:
IOException
NamingException
JMSException

getTopicConnection

public static TopicConnection getTopicConnection(Properties props)
                                          throws IOException,
                                                 NamingException,
                                                 JMSException
Throws:
IOException
NamingException
JMSException

lookupObject

public static Object lookupObject(Context context,
                                  String reference)
                           throws NamingException
Throws:
NamingException

getXATopicConnection

public static XATopicConnection getXATopicConnection()
                                              throws IOException,
                                                     NamingException,
                                                     JMSException
Throws:
IOException
NamingException
JMSException

getSession

public static Session getSession(Connection cnn)
                          throws JMSException
Throws:
JMSException

getXASession

public static XASession getXASession(XAConnection cnn)
                              throws JMSException
Throws:
JMSException

drainQueue

public static void drainQueue(QueueConnection cnn,
                              String queue)
                       throws Exception
Throws:
Exception

drainTopic

public static void drainTopic(TopicConnection cnn,
                              String topic)
                       throws Exception
Throws:
Exception

getTextMessage

public static TextMessage getTextMessage(Connection cnn,
                                         String message)
                                  throws Exception
Throws:
Exception

queueSend

public static void queueSend(QueueConnection cnn,
                             String queueName,
                             String payload,
                             boolean transacted,
                             int ack,
                             String replyTo)
                      throws JMSException
Throws:
JMSException

topicPublish

public static void topicPublish(TopicConnection cnn,
                                String topicName,
                                String payload,
                                boolean transacted,
                                int ack)
                         throws JMSException
Throws:
JMSException

topicPublish

public static void topicPublish(TopicConnection cnn,
                                String topicName,
                                String payload,
                                boolean transacted,
                                int ack,
                                String replyTo)
                         throws JMSException
Throws:
JMSException

queueReceiver

public static Message queueReceiver(QueueConnection cnn,
                                    String queueName,
                                    long timeout)
                             throws JMSException
Throws:
JMSException

topicSubscribe

public static Message topicSubscribe(TopicConnection cnn,
                                     String topicName,
                                     long timeout)
                              throws JMSException
Throws:
JMSException

getTopicSubscriber

public static TopicSubscriber getTopicSubscriber(TopicConnection cnn,
                                                 String topicName)
                                          throws JMSException
Throws:
JMSException

getQueueReceiver

public static QueueReceiver getQueueReceiver(QueueConnection cnn,
                                             String queueName)
                                      throws JMSException
Throws:
JMSException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.