summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-03-25 18:07:51 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-03-25 18:07:51 +0000
commitd84587631a8c6c95bc80bc7ce28dae69e07e6376 (patch)
treee36f2cde0b0a176e09b49eb189ee6456f9877a64 /java
parent59b066dff81e648f68708ca6d0ce0104f5da0500 (diff)
downloadqpid-python-d84587631a8c6c95bc80bc7ce28dae69e07e6376.tar.gz
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
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@758377 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java b/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java
index 9e12e1bef7..66ba47ec13 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/queue/QueueEntryImplTest.java
@@ -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 @@ public class QueueEntryImplTest extends TestCase
Condition wait = waitLock.newCondition();
try
{
- message.setExpiration(System.currentTimeMillis() + 10L);
+ message.setExpiration(System.currentTimeMillis() + 500L);
message.setPublishAndContentHeaderBody(null, mpi, chb);
@@ -150,7 +149,7 @@ public class QueueEntryImplTest extends TestCase
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 @@ public class QueueEntryImplTest extends TestCase
}
}
-
+ _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 @@ public class QueueEntryImplTest extends TestCase
{
message.setPublishAndContentHeaderBody(null, mpi, chb);
-
+
QueueEntry queueEntry = new MockQueueEntry(message);
assertFalse("New messages should not be expired.", queueEntry.expired());