org.apache.qpid.test.unit.transacted
Class CommitRollbackTest

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.unit.transacted.CommitRollbackTest
All Implemented Interfaces:
junit.framework.Test

public class CommitRollbackTest
extends QpidBrokerTestCase

This class tests a number of commits and roll back scenarios Assumptions; - Assumes empty Queue


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
QpidBrokerTestCase.MessageType
 
Field Summary
(package private)  Queue _jmsQueue
           
protected  org.apache.qpid.client.AMQConnection conn
           
protected  String payload
           
protected  String queue
           
protected static int testMethod
           
 
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
CommitRollbackTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testCommitWhithinOnMessage()
          Qpid-1163 Check that when commt is called inside onMessage then the last message is nor redelivered.
 void testGetThenCloseDisconnect()
          GET a text message, close consumer, disconnect before commit, confirm it is still there.
 void testGetThenCloseRollback()
          GET a text message, close message producer, rollback, confirm it is still there.
 void testGetThenDisconnect()
          GET a text message, disconnect before commit, confirm it is still there.
 void testGetThenRollback()
          GET a text message, rollback, confirm it is still there.
 void testPutThenCloseDisconnect()
          PUT a text message, disconnect before commit, confirm it is gone.
 void testPutThenDisconnect()
          PUT a text message, disconnect before commit, confirm it is gone.
 void testPutThenRollback()
          PUT a text message, rollback, confirm message is gone.
 void testPutThenRollbackThenGet()
           
 void testSend2ThenCloseAfter1andTryAgain()
          This test sends two messages receives on of them but doesn't ack it.
 void testSend2ThenRollback()
          Test that rolling back a session purges the dispatcher queue, and the messages arrive in the correct order
 
Methods inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
cleanBroker, createMessage, createNextMessage, drainQueue, getBroker, getBrokerCommand, getClientConnection, getConfigurationStringProperty, getConnection, getConnection, getConnection, getConnectionFactory, 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

conn

protected org.apache.qpid.client.AMQConnection conn

queue

protected String queue

testMethod

protected static int testMethod

payload

protected String payload

_jmsQueue

Queue _jmsQueue
Constructor Detail

CommitRollbackTest

public CommitRollbackTest()
Method Detail

setUp

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

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class QpidBrokerTestCase
Throws:
Exception

testPutThenDisconnect

public void testPutThenDisconnect()
                           throws Exception
PUT a text message, disconnect before commit, confirm it is gone.

Throws:
Exception - On error

testPutThenCloseDisconnect

public void testPutThenCloseDisconnect()
                                throws Exception
PUT a text message, disconnect before commit, confirm it is gone.

Throws:
Exception - On error

testPutThenRollback

public void testPutThenRollback()
                         throws Exception
PUT a text message, rollback, confirm message is gone. The consumer is on the same connection but different session as producer

Throws:
Exception - On error

testGetThenDisconnect

public void testGetThenDisconnect()
                           throws Exception
GET a text message, disconnect before commit, confirm it is still there. The consumer is on a new connection

Throws:
Exception - On error

testGetThenCloseDisconnect

public void testGetThenCloseDisconnect()
                                throws Exception
GET a text message, close consumer, disconnect before commit, confirm it is still there. The consumer is on the same connection but different session as producer

Throws:
Exception - On error

testGetThenRollback

public void testGetThenRollback()
                         throws Exception
GET a text message, rollback, confirm it is still there. The consumer is on the same connection but differnt session to the producer

Throws:
Exception - On error

testGetThenCloseRollback

public void testGetThenCloseRollback()
                              throws Exception
GET a text message, close message producer, rollback, confirm it is still there. The consumer is on the same connection but different session as producer

Throws:
Exception - On error

testSend2ThenRollback

public void testSend2ThenRollback()
                           throws Exception
Test that rolling back a session purges the dispatcher queue, and the messages arrive in the correct order

Throws:
Exception - On error

testSend2ThenCloseAfter1andTryAgain

public void testSend2ThenCloseAfter1andTryAgain()
                                         throws Exception
This test sends two messages receives on of them but doesn't ack it. The consumer is then closed the first message should be returned as redelivered. the second message should be delivered normally.

Throws:
Exception

testPutThenRollbackThenGet

public void testPutThenRollbackThenGet()
                                throws Exception
Throws:
Exception

testCommitWhithinOnMessage

public void testCommitWhithinOnMessage()
                                throws Exception
Qpid-1163 Check that when commt is called inside onMessage then the last message is nor redelivered.

Throws:
Exception


Licensed to the Apache Software Foundation