Author: jmesnil
Date: 2009-11-18 10:05:07 -0500 (Wed, 18 Nov 2009)
New Revision: 8309
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
Log:
HORNETQ-220: Swallowed IIOBE on the Queue's Handler
* added test showing the swallowed IIOBE
Modified: trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2009-11-18
10:28:42 UTC (rev 8308)
+++
trunk/tests/src/org/hornetq/tests/integration/client/MessageGroupingTest.java 2009-11-18
15:05:07 UTC (rev 8309)
@@ -567,7 +567,31 @@
clientSession = sessionFactory.createSession(false, true, true);
clientSession.createQueue(qName, qName, null, false);
}
+
+ // do not swallow exception in DeliverRunner.run() to show the IOOBE on the queue
handlers
+ public void testSwallowedIndexOutOfBoundsException() throws Exception
+ {
+ ClientConsumer consumer = clientSession.createConsumer(qName, null, false);
+ ClientConsumer consumer2 = clientSession.createConsumer(qName, null, false);
+ ClientProducer producer = clientSession.createProducer(qName);
+ ClientMessage message = createTextMessage("m0" , clientSession);
+ message.putStringProperty(MessageImpl.HDR_GROUP_ID, new
SimpleString("g1"));
+ producer.send(message);
+
+ clientSession.start();
+
+ ClientMessage msg = consumer.receive();
+ assertNotNull(msg);
+ msg.acknowledge();
+ assertNull(consumer.receive(500));
+
+ consumer.close();
+ consumer2.close();
+ consumer = clientSession.createConsumer(qName, null, false);
+ assertNull(consumer.receive(500));
+ }
+
private static class DummyMessageHandler implements MessageHandler
{
ArrayList<ClientMessage> list = new ArrayList<ClientMessage>();