Author: clebert.suconic(a)jboss.com
Date: 2010-11-16 18:49:56 -0500 (Tue, 16 Nov 2010)
New Revision: 9899
Modified:
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/server/LVQTest.java
Log:
adding new test
Modified:
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/server/LVQTest.java
===================================================================
---
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2010-11-16
22:04:41 UTC (rev 9898)
+++
branches/Branch_New_Paging_preMerge/tests/src/org/hornetq/tests/integration/server/LVQTest.java 2010-11-16
23:49:56 UTC (rev 9899)
@@ -289,6 +289,29 @@
Assert.assertEquals(m.getBodyBuffer().readString(), "m4");
}
+ public void testSingleTXRollback() throws Exception
+ {
+ ClientProducer producer = clientSessionTxReceives.createProducer(address);
+ ClientConsumer consumer = clientSessionTxReceives.createConsumer(qName1);
+ SimpleString messageId1 = new SimpleString("SMID1");
+ ClientMessage m1 = createTextMessage("m1", clientSession);
+ m1.putStringProperty(Message.HDR_LAST_VALUE_NAME, messageId1);
+ producer.send(m1);
+ clientSessionTxReceives.start();
+ ClientMessage m = consumer.receive(1000);
+ Assert.assertNotNull(m);
+ m.acknowledge();
+ clientSessionTxReceives.rollback();
+ m = consumer.receive(1000);
+ Assert.assertNotNull(m);
+ m.acknowledge();
+ Assert.assertEquals(m.getBodyBuffer().readString(), "m3");
+ m = consumer.receive(1000);
+ Assert.assertNotNull(m);
+ m.acknowledge();
+ Assert.assertEquals(m.getBodyBuffer().readString(), "m4");
+ }
+
public void testMultipleMessagesInTxSend() throws Exception
{
ClientProducer producer = clientSessionTxSends.createProducer(address);
Show replies by date