Repository: activemq-artemis Updated Branches: refs/heads/1.x cea51bee5 -> 2f68737b3
ARTEMIS-995 adding teardown in a few tests (cherry picked from commit baee0038dce91e70b8d72275f1925c895bb0bfe2) Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2f68737b Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2f68737b Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2f68737b Branch: refs/heads/1.x Commit: 2f68737b3fef020aa76bfc7b870f10714f180be5 Parents: cea51be Author: Clebert Suconic <[email protected]> Authored: Fri Feb 24 10:44:36 2017 -0500 Committer: Clebert Suconic <[email protected]> Committed: Fri Feb 24 11:50:55 2017 -0500 ---------------------------------------------------------------------- .../artemis/junit/ActiveMQConsumerResourceTest.java | 2 ++ .../artemis/junit/ActiveMQDynamicProducerResourceTest.java | 4 +++- ...QDynamicProducerResourceWithoutAddressExceptionTest.java | 8 +++++++- .../ActiveMQDynamicProducerResourceWithoutAddressTest.java | 4 +++- .../artemis/junit/ActiveMQProducerResourceTest.java | 3 ++- .../EmbeddedActiveMQResourceCustomConfigurationTest.java | 6 ++++++ .../EmbeddedActiveMQResourceFileConfigurationTest.java | 6 ++++++ .../artemis/junit/EmbeddedActiveMQResourceTest.java | 4 +++- .../junit/MultipleEmbeddedActiveMQResourcesTest.java | 9 ++++++++- 9 files changed, 40 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java index 2f4b11c..c51735a 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResourceTest.java @@ -68,6 +68,8 @@ public class ActiveMQConsumerResourceTest { ClientMessage received = consumer.receiveMessage(); assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_ADDRESS), received); + + server.stop(); } @Test http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java index 5ce855c..891a52f 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceTest.java @@ -77,6 +77,8 @@ public class ActiveMQDynamicProducerResourceTest { ClientMessage receivedTwo = server.receiveMessage(TEST_QUEUE_TWO); assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_QUEUE_TWO), receivedTwo); + + server.stop(); } @Test @@ -103,4 +105,4 @@ public class ActiveMQDynamicProducerResourceTest { sentTwo = producer.sendMessage(TEST_QUEUE_TWO, TEST_BODY, TEST_PROPERTIES); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java index 9e2e2ba..1af2a40 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressExceptionTest.java @@ -21,6 +21,7 @@ import java.util.Map; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.client.ClientMessage; +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -45,6 +46,11 @@ public class ActiveMQDynamicProducerResourceWithoutAddressExceptionTest { ActiveMQDynamicProducerResource producer = new ActiveMQDynamicProducerResource(server.getVmURL()); + @After + public void tear() { + server.stop(); + } + @Rule public RuleChain ruleChain = RuleChain.outerRule(new ThreadLeakCheckRule()).around(server).around(producer); @@ -75,4 +81,4 @@ public class ActiveMQDynamicProducerResourceWithoutAddressExceptionTest { public void testSendStringAndPropertiesToDefaultAddress() throws Exception { sentOne = producer.sendMessage(TEST_BODY, TEST_PROPERTIES); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java index b516029..f3c5d99 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResourceWithoutAddressTest.java @@ -85,6 +85,8 @@ public class ActiveMQDynamicProducerResourceWithoutAddressTest { ClientMessage receivedTwo = server.receiveMessage(TEST_QUEUE_TWO); assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_QUEUE_TWO), receivedTwo); + + server.stop(); } @Test @@ -111,4 +113,4 @@ public class ActiveMQDynamicProducerResourceWithoutAddressTest { sentTwo = producer.sendMessage(TEST_QUEUE_TWO, TEST_BODY, TEST_PROPERTIES); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java index 1405dbc..695fef5 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/ActiveMQProducerResourceTest.java @@ -55,6 +55,7 @@ public class ActiveMQProducerResourceTest { @Rule public RuleChain ruleChain = RuleChain.outerRule(new ThreadLeakCheckRule()).around(server).around(producer); + ClientMessage sent = null; @After @@ -85,4 +86,4 @@ public class ActiveMQProducerResourceTest { sent = producer.sendMessage(TEST_BODY, TEST_PROPERTIES); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java index 27dbf7e..006fdd7 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceCustomConfigurationTest.java @@ -22,6 +22,7 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.CoreQueueConfiguration; import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; import org.apache.activemq.artemis.core.server.Queue; +import org.junit.After; import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; @@ -50,6 +51,11 @@ public class EmbeddedActiveMQResourceCustomConfigurationTest { @Rule public RuleChain rulechain = RuleChain.outerRule(new ThreadLeakCheckRule()).around(server); + @After + public void tear() { + server.stop(); + } + @Test public void testCustomConfiguration() throws Exception { Configuration configuration = server.getServer().getActiveMQServer().getConfiguration(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java index 9e98e81..188efda 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceFileConfigurationTest.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.junit; import java.util.List; import org.apache.activemq.artemis.core.server.Queue; +import org.junit.After; import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; @@ -43,6 +44,11 @@ public class EmbeddedActiveMQResourceFileConfigurationTest { @Rule public RuleChain rulechain = RuleChain.outerRule(new ThreadLeakCheckRule()).around(server); + @After + public void tear() { + server.stop(); + } + @Test public void testConfiguredQueue() throws Exception { assertNotNull(TEST_QUEUE + " should exist", server.locateQueue(TEST_QUEUE)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java index a0b321a..7c7132d 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResourceTest.java @@ -75,6 +75,8 @@ public class EmbeddedActiveMQResourceTest { ClientMessage received = server.receiveMessage(TEST_QUEUE); assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_ADDRESS), received); + + server.stop(); } @Test @@ -97,4 +99,4 @@ public class EmbeddedActiveMQResourceTest { sent = server.sendMessageWithProperties(TEST_ADDRESS, TEST_BODY, TEST_PROPERTIES); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2f68737b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java ---------------------------------------------------------------------- diff --git a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java index fd8c053..1df6258 100644 --- a/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java +++ b/artemis-junit/src/test/java/org/apache/activemq/artemis/junit/MultipleEmbeddedActiveMQResourcesTest.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.junit; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.client.ClientMessage; +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -56,6 +57,12 @@ public class MultipleEmbeddedActiveMQResourcesTest { serverTwo.createQueue(TEST_ADDRESS_TWO, TEST_QUEUE_TWO); } + @After + public void tearDown() { + serverOne.stop(); + serverTwo.stop(); + } + @Test public void testMultipleServers() throws Exception { ClientMessage sentOne = serverOne.sendMessage(TEST_ADDRESS_ONE, TEST_BODY); @@ -71,4 +78,4 @@ public class MultipleEmbeddedActiveMQResourcesTest { assertNotNull(String.format(ASSERT_RECEIVED_FORMAT, TEST_QUEUE_TWO), receivedOne); } -} \ No newline at end of file +}
