You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/03/19 06:09:01 UTC

[55/67] [abbrv] activemq-artemis git commit: More test clean up.

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/9b165cc0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9b165cc0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9b165cc0

Branch: refs/heads/refactor-openwire
Commit: 9b165cc0e0b39a00c0e8e18a33949100066ec2d3
Parents: ad854f7
Author: Howard Gao <ho...@gmail.com>
Authored: Tue Mar 1 21:18:22 2016 +0800
Committer: Clebert Suconic <cl...@apache.org>
Committed: Sat Mar 19 01:07:37 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/9b165cc0/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/9b165cc0/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/9b165cc0/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/9b165cc0/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/9b165cc0/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();
    }
 
    /**