Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 57845 invoked from network); 14 May 2009 11:21:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 May 2009 11:21:37 -0000 Received: (qmail 5764 invoked by uid 500); 14 May 2009 11:21:37 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 5715 invoked by uid 500); 14 May 2009 11:21:37 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 5706 invoked by uid 99); 14 May 2009 11:21:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 May 2009 11:21:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 May 2009 11:21:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3B5A92388866; Thu, 14 May 2009 11:21:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090514112113.3B5A92388866@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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());