More test clean up.
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/45b8be6d Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/45b8be6d Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/45b8be6d Branch: refs/heads/refactor-openwire Commit: 45b8be6d1dc9d14b0aff02f37e451b55f4a66416 Parents: 43c9304 Author: Howard Gao <howard....@gmail.com> Authored: Tue Mar 1 21:18:22 2016 +0800 Committer: Clebert Suconic <clebertsuco...@apache.org> Committed: Tue Mar 15 16:21:23 2016 -0400 ---------------------------------------------------------------------- .../activemq/artemiswrapper/ArtemisBrokerHelper.java | 14 +++++--------- .../broker/artemiswrapper/ArtemisBrokerWrapper.java | 2 -- .../java/org/apache/activemq/JmsQueueBrowserTest.java | 1 + .../JmsTopicSendReceiveWithTwoConnectionsTest.java | 3 +++ .../JmsTopicSendReceiveWithTwoConnectionsTest.java | 2 ++ 5 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45b8be6d/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/artemiswrapper/ArtemisBrokerHelper.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/artemiswrapper/ArtemisBrokerHelper.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/artemiswrapper/ArtemisBrokerHelper.java index 4161859..fce53ee 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/artemiswrapper/ArtemisBrokerHelper.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/artemiswrapper/ArtemisBrokerHelper.java @@ -23,8 +23,11 @@ import java.net.URI; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.command.ActiveMQDestination; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ArtemisBrokerHelper { + private static final Logger LOG = LoggerFactory.getLogger(ArtemisBrokerHelper.class); private static volatile Object service = null; private static Class<?> serviceClass; @@ -42,7 +45,7 @@ public class ArtemisBrokerHelper { // start a tcp transport artemis broker, the broker need to // be invm with client. public static void startArtemisBroker(URI location) throws IOException { - System.out.println("---starting broker, service is there? " + service); + LOG.info("---starting broker, service is there? " + service); if (service != null) { return; } @@ -50,7 +53,7 @@ public class ArtemisBrokerHelper { service = serviceClass.newInstance(); Method startMethod = serviceClass.getMethod("start"); startMethod.invoke(service, (Object[]) null); - System.out.println("started a service instance: " + service); + LOG.info("started a service instance: " + service); } catch (InstantiationException e) { throw new IOException("Inst exception", e); @@ -77,13 +80,6 @@ public class ArtemisBrokerHelper { startMethod.invoke(service, activemqDestination); } - //some tests run broker in setUp(). This need be called - //to prevent auto broker creation. - public static void setBroker(Object startedBroker) { - service = startedBroker; - System.out.println("somebody set a broker service: " + service); - } - public static BrokerService getBroker() { return (BrokerService) service; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45b8be6d/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java index 1a0e297..112d425 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java @@ -39,7 +39,6 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy; import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; -import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.region.policy.PolicyEntry; import org.apache.activemq.broker.region.policy.PolicyMap; @@ -161,7 +160,6 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase { server.start(); - ArtemisBrokerHelper.setBroker(this.bservice); stopped = false; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45b8be6d/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java index 12e7827..6a3cd19 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java @@ -263,6 +263,7 @@ public class JmsQueueBrowserTest extends JmsTestSupport { consumer.close(); } + //ref: https://issues.apache.org/jira/browse/ARTEMIS-384 public void testBrowseReceive() throws Exception { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQQueue destination = new ActiveMQQueue("TEST"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45b8be6d/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java index b5dcacc..216ed10 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java @@ -16,6 +16,8 @@ */ package org.apache.activemq; +import org.apache.activemq.transport.tcp.TcpTransportFactory; + import javax.jms.Connection; import javax.jms.DeliveryMode; import javax.jms.Destination; @@ -109,5 +111,6 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes receiveSession.close(); sendConnection.close(); receiveConnection.close(); + TcpTransportFactory.clearService(); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45b8be6d/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java index 1f8d8da..c999d9a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java @@ -23,6 +23,7 @@ import javax.jms.MessageConsumer; import javax.jms.Session; import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.transport.tcp.TcpTransportFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -105,6 +106,7 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes sendConnection.close(); receiveConnection.close(); TcpTransportFactory.clearService(); + ArtemisBrokerHelper.stopArtemisBroker(); } /**