https://issues.apache.org/jira/browse/AMQ-4083 - update assertions in org.apache.activemq.usecases.ExpiredMessagesWithNoConsumerTest regression to reflect new ack strategy around expired messages

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1409962 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-11-15 20:09:45 +00:00
parent fb62989e5e
commit a8a7693996
1 changed files with 8 additions and 12 deletions

View File

@ -330,17 +330,15 @@ public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport {
Wait.waitFor(new Wait.Condition() { Wait.waitFor(new Wait.Condition() {
public boolean isSatisified() throws Exception { public boolean isSatisified() throws Exception {
// consumer ackLater(delivery ack for expired messages) is based on half the prefetch value return 0 == view.getInFlightCount();
// which will leave half of the prefetch pending till consumer close
return (queuePrefetch/2) -1 == view.getInFlightCount();
} }
}); });
LOG.info("enqueue=" + view.getEnqueueCount() + ", dequeue=" + view.getDequeueCount() LOG.info("enqueue=" + view.getEnqueueCount() + ", dequeue=" + view.getDequeueCount()
+ ", inflight=" + view.getInFlightCount() + ", expired= " + view.getExpiredCount() + ", inflight=" + view.getInFlightCount() + ", expired= " + view.getExpiredCount()
+ ", size= " + view.getQueueSize()); + ", size= " + view.getQueueSize());
assertEquals("inflight didn't reduce to half prefetch minus single delivered message", assertEquals("inflight reduced to duck",
(queuePrefetch/2) -1, view.getInFlightCount()); 0, view.getInFlightCount());
assertEquals("size didn't get back to 0 ", 0, view.getQueueSize()); assertEquals("size didn't get back to 0 ", 0, view.getQueueSize());
assertEquals("dequeues didn't match sent/expired ", sendCount, view.getDequeueCount()); assertEquals("dequeues didn't match sent/expired ", sendCount, view.getDequeueCount());
@ -351,7 +349,7 @@ public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport {
return 0 == view.getInFlightCount(); return 0 == view.getInFlightCount();
} }
}); });
assertEquals("inflight goes to zeor on close", 0, view.getInFlightCount()); assertEquals("inflight goes to zero on close", 0, view.getInFlightCount());
LOG.info("done: " + getName()); LOG.info("done: " + getName());
} }
@ -445,17 +443,15 @@ public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport {
Wait.waitFor(new Wait.Condition() { Wait.waitFor(new Wait.Condition() {
public boolean isSatisified() throws Exception { public boolean isSatisified() throws Exception {
// consumer ackLater(delivery ack for expired messages) is based on half the prefetch value return 0 == view.getInFlightCount();
// which will leave half of the prefetch pending till consumer close
return (queuePrefetch/2) -1 == view.getInFlightCount();
} }
}); });
LOG.info("enqueue=" + view.getEnqueueCount() + ", dequeue=" + view.getDequeueCount() LOG.info("enqueue=" + view.getEnqueueCount() + ", dequeue=" + view.getDequeueCount()
+ ", inflight=" + view.getInFlightCount() + ", expired= " + view.getExpiredCount() + ", inflight=" + view.getInFlightCount() + ", expired= " + view.getExpiredCount()
+ ", size= " + view.getQueueSize()); + ", size= " + view.getQueueSize());
assertEquals("inflight didn't reduce to half prefetch minus single delivered message", assertEquals("inflight didn't reduce to duck",
(queuePrefetch/2) -1, view.getInFlightCount()); 0, view.getInFlightCount());
assertEquals("size doesn't get back to 0 ", 0, view.getQueueSize()); assertEquals("size doesn't get back to 0 ", 0, view.getQueueSize());
assertEquals("dequeues don't match sent/expired ", sendCount, view.getDequeueCount()); assertEquals("dequeues don't match sent/expired ", sendCount, view.getDequeueCount());
@ -483,7 +479,7 @@ public class ExpiredMessagesWithNoConsumerTest extends CombinationTestSupport {
return 0 == view.getInFlightCount(); return 0 == view.getInFlightCount();
} }
}); });
assertEquals("inflight did not go to zeor on close", 0, view.getInFlightCount()); assertEquals("inflight did not go to zero on close", 0, view.getInFlightCount());
LOG.info("done: " + getName()); LOG.info("done: " + getName());
} }