|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.framework.Assert | +--junit.framework.TestCase | +--org.exolab.jmscts.core.JMSTestCase | +--org.exolab.jmscts.core.AbstractConnectionFactoryTestCase | +--org.exolab.jmscts.core.AbstractConnectionTestCase | +--org.exolab.jmscts.core.AbstractSessionTestCase | +--org.exolab.jmscts.core.AbstractMessageTestCase | +--org.exolab.jmscts.core.AbstractSendReceiveTestCase
This class provides a default implementation of the
SendReceiveTestCase
interface.
SendReceiveTestCase
,
SendReceiveTestRunner
Constructor Summary | |
AbstractSendReceiveTestCase(java.lang.String name)
Construct an instance of this class for a specific test case |
Method Summary | |
protected void |
close(MessageReceiver receiver)
Helper to close a MessageReceiver |
protected void |
close(MessageReceiver[] receivers)
Helper to close a list of MessageReceivers The references are removed from the list. |
protected void |
close(MessageSender sender)
Helper to close a MessageSender |
protected void |
close(MessageSender[] senders)
Helper to close a list of MessageSenders. |
protected MessageReceiver |
createReceiver(java.lang.String name)
Helper to create a MessageReceiver for a single destination returned by getDestination(java.lang.String) , using the default test context |
protected MessageReceiver |
createReceiver(TestContext context,
java.lang.String name)
Helper to create a MessageReceiver for a single destination returned by getDestination(java.lang.String) , using the specified test context |
protected MessageReceiver[] |
createReceivers()
Helper to create MessageReceiver instances for each destination returned by getDestinations() |
protected MessageReceiver[] |
createReceivers(TestContext context)
Helper to create MessageReceiver instances for each destination returned by getDestinations() |
protected MessageSender |
createSender(java.lang.String name)
Helper to create a MessageSender for a single destination returned by getDestination(java.lang.String) , using the default test context |
protected MessageSender |
createSender(TestContext context,
java.lang.String name)
Helper to create a MessageSender for a single destination returned by getDestination(java.lang.String) , using the specified test context |
protected MessageSender[] |
createSenders()
Helper to create MessageSender instances for each destination returned by getDestinations() |
protected MessageSender[] |
createSenders(TestContext context)
Helper to create MessageSender instances for each destination returned by getDestinations() |
DeliveryTypes |
getDeliveryTypes()
Return the delivery types to run this test case against This implementation returns the values of any jmscts.delivery javadoc tags associated with the test
case. |
javax.jms.Destination |
getDestination(java.lang.String name)
Returns the named destination |
java.lang.String[] |
getDestinations()
Returns the list of destination names used by this test case. |
boolean |
getDurableOnly()
Determines if this test case only supports durable topic subscribers. |
protected javax.jms.Message |
receive(MessageReceiver receiver)
Helper to verify that a consumer receives a single message |
protected void |
receive(MessageReceiver[] receivers,
int count)
Helper to verify that each consumer receives the correct number of messages |
protected java.util.List |
receive(MessageReceiver receiver,
int count)
Helper to verify that a consumer receives the correct number of messages |
protected javax.jms.Message |
receive(TestContext context,
MessageReceiver receiver)
Helper to verify that a consumer receives a single message |
protected void |
receive(TestContext context,
MessageReceiver[] receivers,
int count)
Helper to verify that each consumer receives the correct number of messages |
protected java.util.List |
receive(TestContext context,
MessageReceiver receiver,
int count)
Helper to verify that a consumer receives the correct number of messages |
protected MessageReceiver |
recreate(MessageReceiver receiver)
Helper to recreate a MessageReceiver. |
protected void |
send(javax.jms.Destination destination,
int count)
Helper to send messages to a destination |
protected void |
send(javax.jms.Message message,
javax.jms.Destination destination)
Helper to send a message |
protected void |
send(MessageSender[] senders,
javax.jms.Message message,
int count)
Helper to send messages to each destination |
protected void |
send(javax.jms.Message message,
java.lang.String name)
Helper to send a message |
protected void |
send(java.lang.String name,
int count)
Helper to send messages to a destination |
protected void |
send(TestContext context,
javax.jms.Destination destination,
int count)
Helper to send messages to a destination |
protected void |
send(TestContext context,
javax.jms.Message message,
javax.jms.Destination destination,
int count)
Helper to send messages to a destination |
protected void |
send(TestContext context,
java.lang.String name,
int count)
Helper to send messages to a destination |
protected javax.jms.Message |
sendReceive(javax.jms.Message message,
javax.jms.Destination destination)
Helper to send a message to a destination, and return a message from the same destination. |
protected javax.jms.Message |
sendReceive(javax.jms.Message message,
java.lang.String name)
Helper to send a message to a destination, and return a message from the same destination |
void |
setDestinations(java.util.Map destinations)
Sets the pre-created destinations corresponding to those returned by getDestinations() . |
Methods inherited from class org.exolab.jmscts.core.AbstractMessageTestCase |
getMessagePopulator, getMessageTypes, shouldCreateMessage, startConnection |
Methods inherited from class org.exolab.jmscts.core.AbstractSessionTestCase |
getAckTypes |
Methods inherited from class org.exolab.jmscts.core.AbstractConnectionTestCase |
setClientID |
Methods inherited from class org.exolab.jmscts.core.AbstractConnectionFactoryTestCase |
getConnectionFactoryTypes |
Methods inherited from class org.exolab.jmscts.core.JMSTestCase |
getContext, getRequirements, setContext, share |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.exolab.jmscts.core.MessageTestCase |
getMessagePopulator, getMessageTypes, shouldCreateMessage, startConnection |
Methods inherited from interface org.exolab.jmscts.core.SessionTestCase |
getAckTypes |
Methods inherited from interface org.exolab.jmscts.core.ConnectionTestCase |
setClientID |
Methods inherited from interface org.exolab.jmscts.core.ConnectionFactoryTestCase |
getConnectionFactoryTypes |
Methods inherited from interface org.exolab.jmscts.core.JMSTest |
getContext, setContext, share |
Methods inherited from interface junit.framework.Test |
countTestCases, run |
Constructor Detail |
public AbstractSendReceiveTestCase(java.lang.String name)
name
- the name of test caseMethod Detail |
public java.lang.String[] getDestinations()
getDestinations
in interface SendReceiveTestCase
null
.public void setDestinations(java.util.Map destinations)
getDestinations()
.setDestinations
in interface SendReceiveTestCase
destinations
- a map of Destination instances keyed on their namepublic javax.jms.Destination getDestination(java.lang.String name)
name
- the destination namepublic DeliveryTypes getDeliveryTypes()
jmscts.delivery
javadoc tags associated with the test
case.
The none are specified, returns DeliveryTypes.ALL
getDeliveryTypes
in interface SendReceiveTestCase
public boolean getDurableOnly()
jmscts.durableonly
javadoc tags associated with the test
case.
The none are specified, returns false
getDurableOnly
in interface SendReceiveTestCase
true
if this test only supports durable topic
subcribers; otherwise false
protected void send(javax.jms.Message message, javax.jms.Destination destination) throws java.lang.Exception
message
- the message to senddestination
- the destinationjava.lang.Exception
- if the message cannot be sent.protected void send(javax.jms.Message message, java.lang.String name) throws java.lang.Exception
message
- the message to sendname
- the name of the destinationjava.lang.Exception
- if the message cannot be sent.protected void send(javax.jms.Destination destination, int count) throws java.lang.Exception
destination
- the destinationcount
- the no. of messages to sendjava.lang.Exception
- if messages cannot be sent.protected void send(java.lang.String name, int count) throws java.lang.Exception
name
- the destination name. This must correspond to a destination
returned by getDestinations()
.count
- the no. of messages to sendjava.lang.Exception
- if messages cannot be sent.protected void send(TestContext context, java.lang.String name, int count) throws java.lang.Exception
context
- the context to usename
- the destination name. This must correspond to a destination
returned by getDestinations()
.count
- the no. of messages to sendjava.lang.Exception
- if messages cannot be sent.protected void send(TestContext context, javax.jms.Destination destination, int count) throws java.lang.Exception
context
- the context to usedestination
- the destinationcount
- the no. of messages to sendjava.lang.Exception
- if messages cannot be sent.protected void send(TestContext context, javax.jms.Message message, javax.jms.Destination destination, int count) throws java.lang.Exception
context
- the context to usemessage
- the message to senddestination
- the destinationcount
- the no. of messages to sendjava.lang.Exception
- if messages cannot be sent.protected javax.jms.Message sendReceive(javax.jms.Message message, javax.jms.Destination destination) throws java.lang.Exception
message
- 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.protected javax.jms.Message sendReceive(javax.jms.Message message, java.lang.String name) throws java.lang.Exception
message
- the message to sendname
- the destination name. This must correspond to a destination
returned by getDestinations()
.java.lang.Exception
- if the message cannot be sent, no message is received,
or more than one message is received.protected MessageReceiver createReceiver(java.lang.String name) throws java.lang.Exception
getDestination(java.lang.String)
, using the default test contextname
- the destination namejava.lang.Exception
- for any errorprotected MessageReceiver createReceiver(TestContext context, java.lang.String name) throws java.lang.Exception
getDestination(java.lang.String)
, using the specified test contextcontext
- the test context to usename
- the destination namejava.lang.Exception
- for any errorprotected MessageReceiver[] createReceivers() throws java.lang.Exception
getDestinations()
java.lang.Exception
- for any errorprotected MessageReceiver[] createReceivers(TestContext context) throws java.lang.Exception
getDestinations()
context
- the test context to usejava.lang.Exception
- for any errorprotected MessageReceiver recreate(MessageReceiver receiver) throws java.lang.Exception
receiver
- the receiver to re-createjava.lang.Exception
- for any errorprotected MessageSender createSender(java.lang.String name) throws java.lang.Exception
getDestination(java.lang.String)
, using the default test contextname
- the destination namejava.lang.Exception
- for any errorprotected MessageSender createSender(TestContext context, java.lang.String name) throws java.lang.Exception
getDestination(java.lang.String)
, using the specified test contextcontext
- the test context to usename
- the destination namejava.lang.Exception
- for any errorprotected MessageSender[] createSenders() throws java.lang.Exception
getDestinations()
java.lang.Exception
- for any errorprotected MessageSender[] createSenders(TestContext context) throws java.lang.Exception
getDestinations()
context
- the test context to usejava.lang.Exception
- for any errorprotected void receive(MessageReceiver[] receivers, int count) throws java.lang.Exception
receivers
- a list of MessageReceiver
instancescount
- the number of expected messagesjava.lang.Exception
- for any errorprotected void receive(TestContext context, MessageReceiver[] receivers, int count) throws java.lang.Exception
context
- the test context to usereceivers
- a list of MessageReceiver
instancescount
- the number of expected messagesjava.lang.Exception
- for any errorprotected javax.jms.Message receive(MessageReceiver receiver) throws java.lang.Exception
receiver
- the message receiverjava.lang.Exception
- for any errorprotected javax.jms.Message receive(TestContext context, MessageReceiver receiver) throws java.lang.Exception
context
- the test context to usereceiver
- the message receiverjava.lang.Exception
- for any errorprotected java.util.List receive(MessageReceiver receiver, int count) throws java.lang.Exception
receiver
- the message receivercount
- the number of expected messagesjava.lang.Exception
- for any errorprotected java.util.List receive(TestContext context, MessageReceiver receiver, int count) throws java.lang.Exception
context
- the test context to usereceiver
- the message receivercount
- the number of expected messagesjava.lang.Exception
- for any errorprotected void send(MessageSender[] senders, javax.jms.Message message, int count) throws java.lang.Exception
senders
- a list of MessageSender
instancesmessage
- the message to sendcount
- the number of messages to sendjava.lang.Exception
- for any errorprotected void close(MessageReceiver[] receivers) throws java.lang.Exception
receivers
- a list of MessageReceiver
instancesjava.lang.Exception
- for any errorprotected void close(MessageReceiver receiver) throws java.lang.Exception
receiver
- the receiverjava.lang.Exception
- for any errorprotected void close(MessageSender[] senders) throws java.lang.Exception
senders
- a list of MessageSender
instancesjava.lang.Exception
- for any errorprotected void close(MessageSender sender) throws java.lang.Exception
sender
- the senderjava.lang.Exception
- for any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |