|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.qpid.test.utils.QpidTestCase
org.apache.qpid.test.utils.QpidBrokerTestCase
org.apache.qpid.test.utils.FailoverBaseCase
org.apache.qpid.test.unit.ack.AcknowledgeTest
org.apache.qpid.test.unit.ack.AcknowledgeOnMessageTest
public class AcknowledgeOnMessageTest
This test extends the synchronous AcknowledgeTest to use a MessageListener and receive messages asynchronously.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
QpidBrokerTestCase.MessageType |
Field Summary | |
---|---|
protected AtomicReference<Exception> |
_causeOfFailure
|
protected CountDownLatch |
_receivedAll
|
Fields inherited from class org.apache.qpid.test.unit.ack.AcknowledgeTest |
---|
_connection, _consumer, _consumerSession, _producer, _queue, NUM_MESSAGES |
Fields inherited from class org.apache.qpid.test.utils.FailoverBaseCase |
---|
_logger, DEFAULT_FAILOVER_TIME, FAILING_PORT, FAILING_VM_PORT, failingPort |
Fields inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
_broker, _brokerLanguage, _brokerLogPrefix, _brokerOutputStream, _brokerPersistent, _brokers, _configFile, _connectionFactory, _connections, _initialContext, _interleaveBrokerLog, _output, _outputFile, _testName, BROKER_READY, CONTENT, CPP, DEFAULT_MANAGEMENT_PORT, DEFAULT_MESSAGE_SIZE, DEFAULT_PORT, DEFAULT_SSL_PORT, DEFAULT_VM_PORT, EXTERNAL, INDEX, JAVA, LOGMONITOR_TIMEOUT, QPID_HOME, QpidHome, QUEUE, RECEIVE_TIMEOUT, TOPIC, VM |
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase |
---|
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY |
Constructor Summary | |
---|---|
AcknowledgeOnMessageTest()
|
Method Summary | |
---|---|
protected void |
fail(Exception e)
Pass the given exception back to the waiting thread to fail the test run. |
void |
init(boolean transacted,
int mode)
Override the synchronous AcknowledgeTest init to provide the _receivedAll CountDownLatch init and ensure that we set the MessageListener. |
void |
onMessage(Message message)
The MessageListener interface that recieves the message and counts down the _receivedAll CountDownLatch. |
void |
setUp()
|
protected void |
testAcking(boolean transacted,
int mode)
This test overrides the testAcking from the simple recieve() model to all for asynchronous receiving of messages. |
Methods inherited from class org.apache.qpid.test.unit.ack.AcknowledgeTest |
---|
doAcknowlegement, testAutoAck, testClientAck, testDupsOk, testNoAck, testPreAck, testTransacted |
Methods inherited from class org.apache.qpid.test.utils.FailoverBaseCase |
---|
failBroker, getConnectionFactory, getFailingPort, tearDown |
Methods inherited from class org.apache.qpid.test.utils.QpidTestCase |
---|
getTestProfileMessageStoreClassName, run |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, runTest, setName, 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, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected CountDownLatch _receivedAll
protected AtomicReference<Exception> _causeOfFailure
Constructor Detail |
---|
public AcknowledgeOnMessageTest()
Method Detail |
---|
public void setUp() throws Exception
setUp
in class AcknowledgeTest
Exception
public void init(boolean transacted, int mode) throws Exception
init
in class AcknowledgeTest
transacted
- mode
-
Exception
protected void testAcking(boolean transacted, int mode) throws Exception
testAcking
in class AcknowledgeTest
transacted
- mode
-
Exception
public void onMessage(Message message)
onMessage
in interface MessageListener
message
- protected void fail(Exception e)
e
- The exception that is causing the test to fail.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |