From 9683ae3f5dacdbcde470e9bc8cbb5263e465560c Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon (cshannon)" Date: Fri, 30 Mar 2018 06:34:36 -0400 Subject: [PATCH] AMQ-6940 - test fix for AMQ6477 test Need to remove the portion of the test that looks at the dispatched list for TopicSubscription as that class no longer tracks message references (cherry picked from commit 84126d8a7a7eb9faf44bef687dcf647e84173f22) --- .../apache/activemq/usecases/AMQ6477Test.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQ6477Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQ6477Test.java index 50292c1e8c..f8b32437cc 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQ6477Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQ6477Test.java @@ -77,16 +77,18 @@ public class AMQ6477Test { private SubType subType; private boolean persistent; - protected enum SubType {QUEUE, TOPIC, DURABLE}; + protected enum SubType {QUEUE, TOPIC, DURABLE} @Parameters(name="subType={0},isPersistent={1}") public static Collection data() { return Arrays.asList(new Object[][] { {SubType.QUEUE, false}, - {SubType.TOPIC, false}, + //Can only test PrefetchSubscriptions for now as TopicSubscriptions don't track the message + //references anymore that are dispatched + // {SubType.TOPIC, false}, {SubType.DURABLE, false}, {SubType.QUEUE, true}, - {SubType.TOPIC, true}, + // {SubType.TOPIC, true}, {SubType.DURABLE, true} }); } @@ -177,11 +179,9 @@ public class AMQ6477Test { protected List getSubscriptionMessages(Subscription sub) throws Exception { Field dispatchedField = null; Field dispatchLockField = null; - - if (sub instanceof TopicSubscription) { - dispatchedField = TopicSubscription.class.getDeclaredField("dispatched"); - dispatchLockField = TopicSubscription.class.getDeclaredField("dispatchLock"); - } else { + //Can only test PrefetchSubscriptions for now as TopicSubscriptions don't track the message + //references anymore that are dispatched + if (sub instanceof PrefetchSubscription) { dispatchedField = PrefetchSubscription.class.getDeclaredField("dispatched"); dispatchLockField = PrefetchSubscription.class.getDeclaredField("dispatchLock"); }