Author: clebert.suconic(a)jboss.com
Date: 2011-03-10 15:55:26 -0500 (Thu, 10 Mar 2011)
New Revision: 10316
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java
Log:
https://issues.jboss.org/browse/JBPAPP-6080 - Adding test
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java 2011-03-10
20:35:19 UTC (rev 10315)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/DuplicateDetectionTest.java 2011-03-10
20:55:26 UTC (rev 10316)
@@ -528,15 +528,23 @@
session.start();
final SimpleString queueName = new
SimpleString("DuplicateDetectionTestQueue");
+
+ final SimpleString queue2 = new SimpleString("queue2");
session.createQueue(queueName, queueName, null, false);
+ session.createQueue(queue2, queue2, null, false);
+
ClientProducer producer = session.createProducer(queueName);
ClientMessage message = createMessage(session, 0);
SimpleString dupID = new SimpleString("abcdefg");
message.putBytesProperty(Message.HDR_DUPLICATE_DETECTION_ID, dupID.getData());
producer.send(message);
+
+ ClientMessage message2 = createMessage(session,0);
+ ClientProducer producer2 = session.createProducer(queue2);
+ producer2.send(message2);
session.commit();
@@ -545,6 +553,8 @@
session = sf.createSession(false, false, false);
session.start();
+
+ ClientConsumer consumer2 = session.createConsumer(queue2);
producer = session.createProducer(queueName);
@@ -560,6 +570,11 @@
message = createMessage(session, 4);
producer.send(message);
+
+ message = consumer2.receive(5000);
+ assertNotNull(message);
+ message.acknowledge();
+
try
{
@@ -578,6 +593,14 @@
message = consumer.receiveImmediate();
Assert.assertNull(message);
+
+
+ message = consumer2.receive(5000);
+ assertNotNull(message);
+
+ message.acknowledge();
+
+ session.commit();
session.close();