From d937e8a8e1302521e576a8c23bbba3d2dec21a7f Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 7 Feb 2017 09:27:58 +0000 Subject: [PATCH] ARTEMIS-945 - fix test and queue delete https://issues.apache.org/jira/browse/ARTEMIS-945 --- .../artemis/core/server/impl/QueueManagerImpl.java | 7 +++++++ .../artemis/tests/integration/amqp/ProtonTest.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java index 692eba7987..82a700f0a5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueManagerImpl.java @@ -34,6 +34,13 @@ public class QueueManagerImpl implements QueueManager { @Override public void run() { Queue queue = server.locateQueue(queueName); + //the queue may already have been deleted and this is a result of that + if (queue == null) { + if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) { + ActiveMQServerLogger.LOGGER.debug("pno queue to delete \"" + queueName + ".\""); + } + return; + } SimpleString address = queue.getAddress(); AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString()); long consumerCount = queue.getConsumerCount(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java index b790f0e13e..7bba91f477 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java @@ -830,7 +830,7 @@ public class ProtonTest extends ProtonTestBase { Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisfied() throws Exception { - return amqpConnection.isClosed(); + return receiver.isClosed(); } }); assertTrue(receiver.isClosed());