fix intermittent failure of test, depended on two distinct calls to currentTimeMillis matching, needs a range check rather than equals

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@774731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-05-14 11:21:12 +00:00
parent 9383c6d697
commit 9124460797
1 changed files with 2 additions and 2 deletions

View File

@ -64,10 +64,10 @@ public class PluginBrokerTest extends JmsTopicSendReceiveTest {
ActiveMQMessage amqMsg = (ActiveMQMessage)message;
if (index == 7) {
// check custom expiration
assertEquals(2000, amqMsg.getExpiration() - amqMsg.getTimestamp());
assertTrue("expiration is in range, depends on two distinct calls to System.currentTimeMillis", 1500 < amqMsg.getExpiration() - amqMsg.getTimestamp());
} else if (index == 9) {
// check ceiling
assertEquals(60000, amqMsg.getExpiration() - amqMsg.getTimestamp());
assertTrue("expiration ceeling is in range, depends on two distinct calls to System.currentTimeMillis", 59500 < amqMsg.getExpiration() - amqMsg.getTimestamp());
} else {
// check default expiration
assertEquals(1000, amqMsg.getExpiration() - amqMsg.getTimestamp());