activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r774731 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java
Date Thu, 14 May 2009 11:21:13 GMT
Author: gtully
Date: Thu May 14 11:21:12 2009
New Revision: 774731

URL: http://svn.apache.org/viewvc?rev=774731&view=rev
Log:
fix intermittent failure of test, depended on two distinct calls to currentTimeMillis matching,
needs a range check rather than equals

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java?rev=774731&r1=774730&r2=774731&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/util/PluginBrokerTest.java
Thu May 14 11:21:12 2009
@@ -64,10 +64,10 @@
 		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());



Mime
View raw message