Package com.sun.ts.tests.jms.common
Class JmsTool
java.lang.Object
com.sun.ts.tests.jms.common.JmsTool
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final intstatic final intstatic final intstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intstatic final Stringstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcloseAllConnections(ArrayList connections) Close any connections opened by the testsvoidClose all resources created by JmsTool except connection resource which gets closed in the closeAllConnections() or closeDefaultConnections() methods.voidClose default connectionsjakarta.jms.QueuecreateNewQueue(String queueName) Creates a new Queue for tests that require more than the Queue.jakarta.jms.TopiccreateNewTopic(String topicName) Creates a new Topic for tests that require more than the Topic.voiddoClientQueueTestCleanup(ArrayList connections, ArrayList queues) Use this method at cleanup time to remove any connections and messages that have remained on the queue.voidUse this method at cleanup time to remove any messages that have remained on the queue.voidflushDestinationJMSContext Flush destination Queue using JMSContext Use this method at cleanup time to remove any messages that have remained on the queue.voidvoidflushQueue(ArrayList qToFlush) Use this method at cleanup time to remove any messages that have remained on the queue.jakarta.jms.ConnectionFactoryDefault getter's for COMMON QUEUE or COMMON TOPIC created objectsjakarta.jms.Connectionjakarta.jms.MessageConsumerjakarta.jms.Destinationjakarta.jms.MessageProducerjakarta.jms.Queuejakarta.jms.QueueConnectionjakarta.jms.QueueReceiverjakarta.jms.QueueSenderjakarta.jms.QueueSessionjakarta.jms.Sessionjakarta.jms.Topicjakarta.jms.TopicConnectionjakarta.jms.TopicPublisherjakarta.jms.TopicSessionjakarta.jms.TopicSubscriberjakarta.jms.ConnectiongetNewConnection(int type) Returns a new Connection for tests that require more than the default connection.jakarta.jms.ConnectiongetNewConnection(int type, String username, String password) Returns a new Queue Connection for tests that require more than the default connection.jakarta.jms.ConnectiongetNewConnection(int type, String username, String password, String lookup) Returns a new Topic Connection for tests that require more than the default connection.jakarta.jms.QueueConnectionFactoryDefault getter's for QUEUE created objectsjakarta.jms.DestinationgetQueueDestination(String lookup) jakarta.jms.TopicConnectionFactoryDefault getter's for TOPIC created objectsjakarta.jms.DestinationgetTopicDestination(String lookup) intgetType()Return connection type (QUEUE or TOPIC)
- 
Field Details- 
QUEUEpublic static final int QUEUE- See Also:
 
- 
TOPICpublic static final int TOPIC- See Also:
 
- 
TX_QUEUEpublic static final int TX_QUEUE- See Also:
 
- 
TX_TOPICpublic static final int TX_TOPIC- See Also:
 
- 
DURABLE_TOPICpublic static final int DURABLE_TOPIC- See Also:
 
- 
DURABLE_TX_TOPICpublic static final int DURABLE_TX_TOPIC- See Also:
 
- 
FACTORIES_ONLYpublic static final int FACTORIES_ONLY- See Also:
 
- 
QUEUE_FACTORYpublic static final int QUEUE_FACTORY- See Also:
 
- 
TOPIC_FACTORYpublic static final int TOPIC_FACTORY- See Also:
 
- 
DURABLE_TOPIC_FACTORYpublic static final int DURABLE_TOPIC_FACTORY- See Also:
 
- 
FACTORY_Qpublic static final int FACTORY_Q- See Also:
 
- 
FACTORY_Tpublic static final int FACTORY_T- See Also:
 
- 
FACTORY_DTpublic static final int FACTORY_DT- See Also:
 
- 
COMMON_Qpublic static final int COMMON_Q- See Also:
 
- 
COMMON_Tpublic static final int COMMON_T- See Also:
 
- 
COMMON_QTXpublic static final int COMMON_QTX- See Also:
 
- 
COMMON_TTXpublic static final int COMMON_TTX- See Also:
 
- 
COMMON_FACTORYpublic static final int COMMON_FACTORY- See Also:
 
- 
JMS_VERSION- See Also:
 
- 
JMS_MAJOR_VERSIONpublic static final int JMS_MAJOR_VERSION- See Also:
 
- 
JMS_MINOR_VERSIONpublic static final int JMS_MINOR_VERSION- See Also:
 
- 
TCKTESTQUEUENAME- See Also:
 
- 
TCKTESTTOPICNAME- See Also:
 
- 
TCKCONNECTIONFACTORY- See Also:
 
- 
TCKQUEUECONNECTIONFACTORY- See Also:
 
- 
TCKTOPICCONNECTIONFACTORY- See Also:
 
- 
TCKDURABLETOPICCONNECTIONFACTORY- See Also:
 
- 
TESTQUEUENAME- See Also:
 
- 
TESTTOPICNAME- See Also:
 
- 
CONNECTIONFACTORY- See Also:
 
- 
QUEUECONNECTIONFACTORY- See Also:
 
- 
TOPICCONNECTIONFACTORY- See Also:
 
- 
DURABLETOPICCONNECTIONFACTORY- See Also:
 
- 
JMSDEFAULT- See Also:
 
 
- 
- 
Constructor Details- 
JmsToolPublic constructor. Takes a connection type and mode argument. Create connection factory, connection type, and single producer/consumer for either QUEUE or TOPIC client.- Parameters:
- int- type (QUEUE type or TOPIC type)
- String- m (JakartaEE mode or Standalone mode)
- Throws:
- Exception
 
- 
JmsToolPublic constructor. Takes connection type, username, password, jndi lookup name, and mode argument. Create connection factory, connection type, and single producer/consumer for TOPIC client.- Parameters:
- int- type (TOPIC type)
- String- user (username)
- String- pw (password)
- String- lookup (connection factory to lookup)
- String- m (JakartaEE mode or Standalone mode)
- Throws:
- Exception
 
- 
JmsToolPublic constructor. Takes connection type, username, password, and mode argument. Create connection factory, connection type, and single producer/consumer for either QUEUE or TOPIC client. If just a FACTORY type is passed then just create the connection factory type.- Parameters:
- int- type (QUEUE type or TOPIC type or FACTORY type)
- String- user (username)
- String- pw (password)
- String- m (JakartaEE mode or Standalone mode)
- Throws:
- Exception
 
 
- 
- 
Method Details- 
getConnectionFactoryDefault getter's for COMMON QUEUE or COMMON TOPIC created objects- Throws:
- Exception
 
- 
getDefaultConnection- Throws:
- Exception
 
- 
getDefaultSession- Throws:
- Exception
 
- 
getDefaultProducer- Throws:
- Exception
 
- 
getDefaultConsumer- Throws:
- Exception
 
- 
getDefaultDestination- Throws:
- Exception
 
- 
createNewTopicCreates a new Topic for tests that require more than the Topic. The topic should be setup by the administrator- Parameters:
- String- the topic name
- Throws:
- Exception
 
- 
createNewQueueCreates a new Queue for tests that require more than the Queue. The queue should already be setup by the administrator- Parameters:
- String- the queue name
- Throws:
- Exception
 
- 
closeAllResourcesClose all resources created by JmsTool except connection resource which gets closed in the closeAllConnections() or closeDefaultConnections() methods.- Throws:
- Exception
 
- 
closeAllConnectionsClose any connections opened by the tests- Throws:
- Exception
- See Also:
- 
- is allowable to do a second call to close connection per the JMS Specification
 
 
- 
closeDefaultConnectionsClose default connections- Throws:
- Exception
- See Also:
- 
- is allowable to do a second call to close connection per the JMS Specification
 
 
- 
getQueueConnectionFactorypublic jakarta.jms.QueueConnectionFactory getQueueConnectionFactory()Default getter's for QUEUE created objects
- 
getDefaultQueueConnectionpublic jakarta.jms.QueueConnection getDefaultQueueConnection()
- 
getDefaultQueueSessionpublic jakarta.jms.QueueSession getDefaultQueueSession()
- 
getDefaultQueueReceiverpublic jakarta.jms.QueueReceiver getDefaultQueueReceiver()
- 
getDefaultQueueSenderpublic jakarta.jms.QueueSender getDefaultQueueSender()
- 
getDefaultQueuepublic jakarta.jms.Queue getDefaultQueue()
- 
getQueueDestination- Throws:
- Exception
 
- 
getTopicConnectionFactorypublic jakarta.jms.TopicConnectionFactory getTopicConnectionFactory()Default getter's for TOPIC created objects
- 
getDefaultTopicConnectionpublic jakarta.jms.TopicConnection getDefaultTopicConnection()
- 
getDefaultTopicSessionpublic jakarta.jms.TopicSession getDefaultTopicSession()
- 
getDefaultTopicSubscriberpublic jakarta.jms.TopicSubscriber getDefaultTopicSubscriber()
- 
getDefaultTopicPublisherpublic jakarta.jms.TopicPublisher getDefaultTopicPublisher()
- 
getDefaultTopicpublic jakarta.jms.Topic getDefaultTopic()
- 
getTopicDestination- Throws:
- Exception
 
- 
doClientQueueTestCleanupUse this method at cleanup time to remove any connections and messages that have remained on the queue.- Parameters:
- ArrayList- connections list of open connections
- ArrayList- queues list of queues to flush
 
- 
flushDestinationUse this method at cleanup time to remove any messages that have remained on the queue.- Throws:
- Exception
 
- 
flushQueueUse this method at cleanup time to remove any messages that have remained on the queue.- Parameters:
- Queue- qToFlush[] QUEUE
- Throws:
- Exception
 
- 
flushQueue- Throws:
- Exception
 
- 
getNewConnectionpublic jakarta.jms.Connection getNewConnection(int type, String username, String password) throws Exception Returns a new Queue Connection for tests that require more than the default connection. The returned Connection object must be explicitly cast into a QueueConnection.- Parameters:
- int- type (QUEUE type)
- Returns:
- Connection from the default ConnectionFactory
- Throws:
- Exception
 
- 
getNewConnectionpublic jakarta.jms.Connection getNewConnection(int type, String username, String password, String lookup) throws Exception Returns a new Topic Connection for tests that require more than the default connection. The returned Connection object must be explicitly cast into a TopicConnection.- Parameters:
- int- type (TOPIC type)
- Returns:
- Connection from the default ConnectionFactory
- Throws:
- Exception
 
- 
getNewConnectionReturns a new Connection for tests that require more than the default connection. The returned Connection object must be explicitly cast into a QueueConnection or TopicConnection.- Parameters:
- int- type (QUEUE type or TOPIC type)
- Returns:
- Connection from the default Queue or Topic ConnectionFactory
- Throws:
- Exception
 
- 
getTypepublic int getType()Return connection type (QUEUE or TOPIC)
- 
flushDestinationJMSContextflushDestinationJMSContext Flush destination Queue using JMSContext Use this method at cleanup time to remove any messages that have remained on the queue.- Throws:
- Exception
 
 
-