Author: clebert.suconic(a)jboss.com
Date: 2009-11-19 20:30:34 -0500 (Thu, 19 Nov 2009)
New Revision: 8329
Modified:
branches/ClebertTemporary/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
Log:
Fixing tests
Modified:
branches/ClebertTemporary/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java
===================================================================
---
branches/ClebertTemporary/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2009-11-20
01:23:23 UTC (rev 8328)
+++
branches/ClebertTemporary/tests/src/org/hornetq/tests/integration/client/DeadLetterAddressTest.java 2009-11-20
01:30:34 UTC (rev 8329)
@@ -179,6 +179,14 @@
clientSession.rollback();
}
+ long timeout = System.currentTimeMillis() + 5000;
+
+ // DLA transfer is asynchronous fired on the rollback
+ while (System.currentTimeMillis() < timeout &&
((Queue)server.getPostOffice().getBinding(qName).getBindable()).getMessageCount() != 0)
+ {
+ Thread.sleep(1);
+ }
+
assertEquals(0,
((Queue)server.getPostOffice().getBinding(qName).getBindable()).getMessageCount());
ClientMessage m = clientConsumer.receiveImmediate();
assertNull(m);