Author: jmesnil
Date: 2009-11-04 03:38:44 -0500 (Wed, 04 Nov 2009)
New Revision: 8205
Modified:
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java
Log:
fixed test
Modified:
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java 2009-11-04
08:38:24 UTC (rev 8204)
+++
trunk/tests/src/org/hornetq/tests/integration/scheduling/ScheduledMessageTest.java 2009-11-04
08:38:44 UTC (rev 8205)
@@ -565,9 +565,8 @@
session.start(xid, XAResource.TMNOFLAGS);
ClientProducer producer = session.createProducer(atestq);
ClientMessage message = createDurableMessage(session,
"testINVMCoreClient");
- Calendar cal = Calendar.getInstance();
- cal.roll(Calendar.SECOND, 10);
- message.putLongProperty(MessageImpl.HDR_SCHEDULED_DELIVERY_TIME,
cal.getTimeInMillis());
+ long time = System.currentTimeMillis() + 1000;
+ message.putLongProperty(MessageImpl.HDR_SCHEDULED_DELIVERY_TIME, time);
producer.send(message);
session.end(xid, XAResource.TMSUCCESS);
session.prepare(xid);
@@ -589,8 +588,10 @@
session.start();
session.start(xid2, XAResource.TMNOFLAGS);
- ClientMessage message2 = consumer.receive(10000);
- assertTrue(System.currentTimeMillis() >= cal.getTimeInMillis());
+ ClientMessage message2 = consumer.receive(11000);
+ long end = System.currentTimeMillis();
+ System.out.println("elapsed time = " + (end - time));
+ assertTrue(end >= time);
assertNotNull(message2);
assertEquals("testINVMCoreClient", message2.getBody().readString());
Show replies by date