|
||||||||||
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
org.apache.qpid.test.unit.ack.AcknowledgeAfterFailoverOnMessageTest
public class AcknowledgeAfterFailoverOnMessageTest
The AcknowlegeAfterFailoverOnMessageTests Extends the OnMessage AcknowledgeTests to validate that after the client has failed over that the client can still receive and ack messages. All the AcknowledgeTest ack modes are exercised here though some are disabled due to know issues (e.g. DupsOk, AutoAck : QPID-143 and the clientAck and dirtyClientAck due to QPID-1816) This class has two main test structures, overrides of AcknowledgeOnMessageTest to perform the clean acking based on session ack mode and a series of dirty ack tests that test what happends if you receive a message then try and ack AFTER you have failed over.
Nested Class Summary | |
---|---|
(package private) class |
AcknowledgeAfterFailoverOnMessageTest.DirtyAckingHandler
|
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase |
---|
QpidBrokerTestCase.MessageType |
Field Summary | |
---|---|
(package private) boolean |
_cleaned
|
protected CountDownLatch |
_failoverCompleted
|
(package private) int |
_msgCount
|
Fields inherited from class org.apache.qpid.test.unit.ack.AcknowledgeOnMessageTest |
---|
_causeOfFailure, _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 | |
---|---|
AcknowledgeAfterFailoverOnMessageTest()
|
Method Summary | |
---|---|
void |
bytesReceived(long count)
|
void |
bytesSent(long count)
|
void |
doAcknowlegement(Message msg)
Perform the acknowledgement of messages if additionally required. |
void |
failBroker(int port)
Override so we can block until failover has completd |
void |
failoverComplete()
|
void |
init(boolean transacted,
int mode)
Override default init to add connectionListener so we can verify that failover took place |
boolean |
preFailover(boolean redirect)
|
protected void |
prepBroker(int index)
Prepare the broker for the next round. |
boolean |
preResubscribe()
|
void |
setUp()
|
protected void |
testDirtyAcking(boolean transacted,
int mode)
Test that Acking/Committing a message received before failover causes an exception at commit/ack time. |
void |
testDirtyAckingTransacted()
|
void |
testDirtyClientAck()
|
Methods inherited from class org.apache.qpid.test.unit.ack.AcknowledgeOnMessageTest |
---|
fail, onMessage, testAcking |
Methods inherited from class org.apache.qpid.test.unit.ack.AcknowledgeTest |
---|
testAutoAck, testClientAck, testDupsOk, testNoAck, testPreAck, testTransacted |
Methods inherited from class org.apache.qpid.test.utils.FailoverBaseCase |
---|
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 _failoverCompleted
int _msgCount
boolean _cleaned
Constructor Detail |
---|
public AcknowledgeAfterFailoverOnMessageTest()
Method Detail |
---|
public void setUp() throws Exception
setUp
in class AcknowledgeOnMessageTest
Exception
public void init(boolean transacted, int mode) throws Exception
init
in class AcknowledgeOnMessageTest
transacted
- create a transacted session for this testmode
- if not transacted what ack mode to use for this test
Exception
- if a problem occured during test setup.protected void prepBroker(int index) throws Exception
index
-
Exception
public void doAcknowlegement(Message msg) throws JMSException
AcknowledgeTest
doAcknowlegement
in class AcknowledgeTest
JMSException
protected void testDirtyAcking(boolean transacted, int mode) throws Exception
transacted
- is this session trasactedmode
- What ack mode should be used if not trasacted
Exception
- if something goes wrong.public void testDirtyClientAck() throws Exception
Exception
public void testDirtyAckingTransacted() throws Exception
Exception
public void bytesSent(long count)
bytesSent
in interface org.apache.qpid.jms.ConnectionListener
public void bytesReceived(long count)
bytesReceived
in interface org.apache.qpid.jms.ConnectionListener
public boolean preFailover(boolean redirect)
preFailover
in interface org.apache.qpid.jms.ConnectionListener
public boolean preResubscribe()
preResubscribe
in interface org.apache.qpid.jms.ConnectionListener
public void failoverComplete()
failoverComplete
in interface org.apache.qpid.jms.ConnectionListener
public void failBroker(int port)
failBroker
in class FailoverBaseCase
port
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |