From 9e214e9c43d32156228c7414bf87cb06b233c7bd Mon Sep 17 00:00:00 2001 From: jbertram Date: Fri, 30 Jan 2015 13:34:49 -0600 Subject: [PATCH 1/2] remove unnecessary cache operation --- .../tests/integration/persistence/DuplicateCacheTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/DuplicateCacheTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/DuplicateCacheTest.java index 578f623cb5..29dfab5c4e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/DuplicateCacheTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/DuplicateCacheTest.java @@ -71,9 +71,6 @@ public class DuplicateCacheTest extends StorageManagerTestBase cache.deleteFromCache(id); assertFalse(cache.contains(id)); - - cache.deleteFromCache(id); - } From fe11fb4c02e3fc0492191224b366df878329e809 Mon Sep 17 00:00:00 2001 From: jbertram Date: Fri, 30 Jan 2015 13:35:16 -0600 Subject: [PATCH 2/2] avoid potential NPE --- .../integration/cluster/distribution/ClusterTestBase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/distribution/ClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/distribution/ClusterTestBase.java index 9c4d1185e8..7370f33c67 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/distribution/ClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/cluster/distribution/ClusterTestBase.java @@ -1201,16 +1201,16 @@ public abstract class ClusterTestBase extends ServiceTestBase ClientMessage message = holder.consumer.receive(WAIT_TIMEOUT); - message.acknowledge(); - - consumers[consumerIDs[count]].session.commit(); - Assert.assertNotNull("consumer " + consumerIDs[count] + " did not receive message " + i, message); Assert.assertEquals("consumer " + consumerIDs[count] + " message " + i, i, message.getObjectProperty(ClusterTestBase.COUNT_PROP)); + message.acknowledge(); + + consumers[consumerIDs[count]].session.commit(); + } count++;