|
||||||||||
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.client.RollbackOrderTest
public class RollbackOrderTest
RollbackOrderTest, QPID-1864, QPID-1871 Description: The problem that this test is exposing is that the dispatcher used to be capable of holding on to a message when stopped. This ment that when the rollback was called and the dispatcher stopped it may have hold of a message. So after all the local queues(preDeliveryQueue, SynchronousQueue, PostDeliveryTagQueue) have been cleared the client still had a single message, the one the dispatcher was holding on to. As a result the TxRollback operation would run and then release the dispatcher. Whilst the dispatcher would then proceed to reject the message it was holiding the Broker would already have resent that message so the rejection would silently fail. And the client would receieve that single message 'early', depending on the number of messages already recevied when rollback was called. Aims: The tests puts 50 messages on to the queue. The test then tries to cause the dispatcher to stop whilst it is in the process of moving a message from the preDeliveryQueue to a consumers sychronousQueue. To exercise this path we have 50 message flowing to the client to give the dispatcher a bit of work to do moving messages. Then we loop - 10 times - Validating that the first message received is always message 1. - Receive a few more so that there are a few messages to reject. - call rollback, to try and catch the dispatcher mid process. Outcome: The hope is that we catch the dispatcher mid process and cause a BasicReject to fail. Which will be indicated in the log but will also cause that failed rejected message to be the next to be delivered which will not be message 1 as expected. We are testing a race condition here but we can check through the log file if the race condition occured. However, performing that check will only validate the problem exists and will not be suitable as part of a system test.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
QpidBrokerTestCase.MessageType |
Field Summary |
---|
Fields inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
_broker, _brokerLanguage, _brokerLogPrefix, _brokerOutputStream, _brokerPersistent, _brokers, _configFile, _connectionFactory, _connections, _initialContext, _interleaveBrokerLog, _logger, _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 | |
---|---|
RollbackOrderTest()
|
Method Summary | |
---|---|
void |
setUp()
|
void |
tearDown()
|
void |
testOrderingAfterRollback()
|
void |
testOrderingAfterRollbackOnMessage()
|
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 |
Constructor Detail |
---|
public RollbackOrderTest()
Method Detail |
---|
public void setUp() throws Exception
setUp
in class QpidBrokerTestCase
Exception
public void testOrderingAfterRollback() throws Exception
Exception
public void testOrderingAfterRollbackOnMessage() throws Exception
Exception
public void tearDown() throws Exception
tearDown
in class QpidBrokerTestCase
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |