You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2009/03/25 19:07:59 UTC

svn commit: r758377 - /qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java

Author: ritchiem
Date: Wed Mar 25 18:07:51 2009
New Revision: 758377

URL: http://svn.apache.org/viewvc?rev=758377&view=rev
Log:
QEIT.testExpiry() only allows 10ms for creating the QueueEntry. Depending on the running platform and the result of currentTimeMillis() it can be a close to allowing expiry

Modified:
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java?rev=758377&r1=758376&r2=758377&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java Wed Mar 25 18:07:51 2009
@@ -21,20 +21,19 @@
 package org.apache.qpid.server.queue;
 
 import junit.framework.TestCase;
+import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.BasicContentHeaderProperties;
 import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.ContentHeaderProperties;
-import org.apache.qpid.framing.abstraction.ContentChunk;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl;
-import org.apache.qpid.server.store.StoreContext;
 
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.ReentrantLock;
 
 public class QueueEntryImplTest extends TestCase
 {
+    protected static final Logger _log = Logger.getLogger(QueueEntryImplTest.class);
 
     /** Test the Redelivered state of a QueueEntryImpl */
     public void testRedelivered()
@@ -141,7 +140,7 @@
         Condition wait = waitLock.newCondition();
         try
         {
-            message.setExpiration(System.currentTimeMillis() + 10L);
+            message.setExpiration(System.currentTimeMillis() + 500L);
 
             message.setPublishAndContentHeaderBody(null, mpi, chb);
 
@@ -150,7 +149,7 @@
             assertFalse("New messages should not be expired.", queueEntry.expired());
 
             final long MILLIS = 1000000L;
-            long waitTime = 20 * MILLIS;
+            long waitTime = 500 * MILLIS;
 
             while (waitTime > 0)
             {
@@ -171,7 +170,9 @@
                 }
 
             }
-
+            _log.info("m.GetExpiration:" + message.getExpiration());
+            _log.info("qe.GetExpiration:" + ((QueueEntryImpl)queueEntry).getExpiration());
+            _log.info("AfterSleep:" + System.currentTimeMillis());
             assertTrue("After a sleep messages should now be expired.", queueEntry.expired());
 
         }
@@ -200,7 +201,7 @@
         {
 
             message.setPublishAndContentHeaderBody(null, mpi, chb);
-            
+
             QueueEntry queueEntry = new MockQueueEntry(message);
 
             assertFalse("New messages should not be expired.", queueEntry.expired());



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org