org.apache.qpid.test.unit.ack
Class RecoverTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.qpid.test.utils.QpidTestCase
              extended by org.apache.qpid.test.utils.QpidBrokerTestCase
                  extended by org.apache.qpid.test.utils.FailoverBaseCase
                      extended by org.apache.qpid.test.unit.ack.RecoverTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
FailoverBeforeConsumingRecoverTest

public class RecoverTest
extends FailoverBaseCase


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
QpidBrokerTestCase.MessageType
 
Field Summary
protected  org.apache.qpid.client.AMQConnection _connection
           
protected  MessageConsumer _consumer
           
protected  org.apache.qpid.jms.Session _consumerSession
           
(package private) static org.slf4j.Logger _logger
           
(package private) static int SENT_COUNT
           
 
Fields inherited from class org.apache.qpid.test.utils.FailoverBaseCase
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
RecoverTest()
           
 
Method Summary
protected  void initTest()
           
protected  void setUp()
           
 void testAcknowledgePerConsumer()
           
 void testOderingWithAsyncConsumer()
          Goal : Same as testOderingWithSyncConsumer Test strategy : Same as testOderingWithSyncConsumer but using a Message Listener instead of a sync receive().
 void testOderingWithSyncConsumer()
          Goal : Check if ordering is preserved when doing recovery under reasonable circumstances.
 void testRecoverInAutoAckListener()
           
 void testRecoverResendsMsgs()
           
 void testRecoverResendsMsgsAckOnEarlier()
           
protected  Message validateNextMessages(int nextCount, int startIndex)
           
protected  void validateRemainingMessages(int remaining)
           
 
Methods inherited from class org.apache.qpid.test.utils.FailoverBaseCase
failBroker, getConnectionFactory, getFailingPort, tearDown
 
Methods inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
cleanBroker, createMessage, createNextMessage, drainQueue, getBroker, getBrokerCommand, getClientConnection, getConfigurationStringProperty, getConnection, getConnection, getConnection, getConnectionFactory, getConnectionURL, getInitialContext, getLogger, getManagementPort, getMessageSize, getPort, getPort, getTestConfigFile, getTestQueue, getTestQueueName, getTestVirtualhostsFile, isBroker010, isBroker08, isBrokerStorePersistent, isCppBroker, isExternalBroker, isJavaBroker, makeVirtualHostPersistent, reloadBrokerSecurityConfig, restartBroker, restartBroker, revertLoggingLevels, revertSystemProperties, runBare, saveTestConfiguration, saveTestVirtualhosts, sendMessage, sendMessage, sendMessage, setBrokerEnvironment, setBrokerOnlySystemProperty, setConfigurationProperty, setLoggerLevel, setMessageSize, setSystemProperty, setSystemProperty, setTestClientSystemProperty, startBroker, startBroker, stopBroker, stopBroker
 
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

_logger

static final org.slf4j.Logger _logger

_connection

protected org.apache.qpid.client.AMQConnection _connection

_consumerSession

protected org.apache.qpid.jms.Session _consumerSession

_consumer

protected MessageConsumer _consumer

SENT_COUNT

static final int SENT_COUNT
See Also:
Constant Field Values
Constructor Detail

RecoverTest

public RecoverTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class FailoverBaseCase
Throws:
Exception

initTest

protected void initTest()
                 throws Exception
Throws:
Exception

validateNextMessages

protected Message validateNextMessages(int nextCount,
                                       int startIndex)
                                throws JMSException
Throws:
JMSException

validateRemainingMessages

protected void validateRemainingMessages(int remaining)
                                  throws JMSException
Throws:
JMSException

testRecoverResendsMsgs

public void testRecoverResendsMsgs()
                            throws Exception
Throws:
Exception

testRecoverResendsMsgsAckOnEarlier

public void testRecoverResendsMsgsAckOnEarlier()
                                        throws Exception
Throws:
Exception

testAcknowledgePerConsumer

public void testAcknowledgePerConsumer()
                                throws Exception
Throws:
Exception

testRecoverInAutoAckListener

public void testRecoverInAutoAckListener()
                                  throws Exception
Throws:
Exception

testOderingWithSyncConsumer

public void testOderingWithSyncConsumer()
                                 throws Exception
Goal : Check if ordering is preserved when doing recovery under reasonable circumstances. Refer QPID-2471 for more details. Test strategy : Send 8 messages to a topic. The consumer will call recover until it sees a message 5 times, at which point it will ack that message. It will continue the above until it acks all the messages. While doing so it will verify that the messages are not delivered out of order.

Throws:
Exception

testOderingWithAsyncConsumer

public void testOderingWithAsyncConsumer()
                                  throws Exception
Goal : Same as testOderingWithSyncConsumer Test strategy : Same as testOderingWithSyncConsumer but using a Message Listener instead of a sync receive().

Throws:
Exception


Licensed to the Apache Software Foundation