|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jmscts.core.MessagingHelper
Helper class for performing messaging operations
SessionHelper
,
TestContext
Method Summary | |
static java.util.List |
receive(MessageReceiver receiver,
int count,
long timeout)
Helper to receive messages |
static java.util.List |
receive(TestContext context,
MessageReceiver receiver,
int count)
Helper to receive messages |
static void |
send(TestContext context,
javax.jms.Destination destination,
int count)
Helper to send messages to a destination, using the message supplied by the test context |
static void |
send(TestContext context,
javax.jms.Message message,
javax.jms.Destination destination,
int count)
Helper to send messages to a destination. |
static javax.jms.Message |
sendReceive(TestContext context,
javax.jms.Destination destination)
Helper to send a message to a destination, and return a message from the same destination. |
static javax.jms.Message |
sendReceive(TestContext context,
javax.jms.Message message,
javax.jms.Destination destination)
Helper to send a message to a destination, and return a message from the same destination. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void send(TestContext context, javax.jms.Destination destination, int count) throws java.lang.Exception
If the session is transactional, it will be committed.
context
- the test contextdestination
- the destinationcount
- the number of times to send the messagejava.lang.Exception
- for any errorpublic static void send(TestContext context, javax.jms.Message message, javax.jms.Destination destination, int count) throws java.lang.Exception
If the session is transactional, it will be committed.
context
- the test contextmessage
- the message to senddestination
- the destinationcount
- the number of times to send the messagejava.lang.Exception
- for any errorpublic static javax.jms.Message sendReceive(TestContext context, javax.jms.Destination destination) throws java.lang.Exception
If the session is transactional, it will be committed.
Note: the persistent state of the receiver is removed on completion,
so tests for durable topic subcribers should not use this method if
more than one message is expected.
context
- the test contextdestination
- the destinationjava.lang.Exception
- if the message cannot be sent, no message is received,
or more than one message is received.public static javax.jms.Message sendReceive(TestContext context, javax.jms.Message message, javax.jms.Destination destination) throws java.lang.Exception
If the session is transactional, it will be committed.
Note: the persistent state of the receiver is removed on completion,
so tests for durable topic subcribers should not use this method if
more than one message is expected.
context
- the test contextmessage
- the message to senddestination
- the destinationjava.lang.Exception
- if the message cannot be sent, no message is received,
or more than one message is received.public static java.util.List receive(TestContext context, MessageReceiver receiver, int count) throws java.lang.Exception
context
- the test contextreceiver
- the message receivercount
- the expected number of messagesjava.lang.Exception
- if the receive fails, or the wrong number of
messages were returnedpublic static java.util.List receive(MessageReceiver receiver, int count, long timeout) throws java.lang.Exception
receiver
- the message receivercount
- the expected number of messagestimeout
- the maximum time to wait for each messagejava.lang.Exception
- if the receive fails, or the wrong number of
messages were returned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |