activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5621
Date Fri, 27 Feb 2015 00:27:01 GMT
Repository: activemq
Updated Branches:
  refs/heads/master b5ef92814 -> 5667e4ddc


https://issues.apache.org/jira/browse/AMQ-5621

Disable the JMX bits on some additional tests that don't use it. 

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/5667e4dd
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/5667e4dd
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/5667e4dd

Branch: refs/heads/master
Commit: 5667e4ddcc44e1331cafea2c1537afeaa550a2cd
Parents: b5ef928
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Feb 26 19:26:41 2015 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Feb 26 19:26:41 2015 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/bugs/AMQ5035Test.java   |  1 +
 .../org/apache/activemq/bugs/AMQ5136Test.java   |  2 ++
 .../org/apache/activemq/bugs/AMQ5212Test.java   | 10 +++---
 .../org/apache/activemq/bugs/AMQ5274Test.java   | 34 +++++++++++---------
 .../org/apache/activemq/bugs/AMQ5421Test.java   |  1 +
 5 files changed, 28 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/5667e4dd/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
index 13ddd30..f552b15 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
@@ -49,6 +49,7 @@ public class AMQ5035Test {
         brokerService = BrokerFactory.createBroker(xbean + confBase + "/activemq.xml");
         connectionUri = brokerService.getTransportConnectorByScheme("tcp").getPublishableConnectString();
         brokerService.setDeleteAllMessagesOnStartup(true);
+        brokerService.getManagementContext().setCreateConnector(false);
         brokerService.start();
         brokerService.waitUntilStarted();
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5667e4dd/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5136Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5136Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5136Test.java
index c2cb11e..904b2de 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5136Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5136Test.java
@@ -23,6 +23,7 @@ import javax.jms.JMSException;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.Topic;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerRegistry;
 import org.apache.activemq.broker.BrokerService;
@@ -37,6 +38,7 @@ public class AMQ5136Test {
     public void startBroker() throws Exception {
         brokerService = new BrokerService();
         brokerService.setPersistent(false);
+        brokerService.setUseJmx(false);
         brokerService.start();
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5667e4dd/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java
index 4c07655..064a5be 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java
@@ -17,14 +17,19 @@
 
 package org.apache.activemq.bugs;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import java.util.Arrays;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
+
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
+
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.ActiveMQMessageProducer;
@@ -40,10 +45,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 @RunWith(value = Parameterized.class)
 public class AMQ5212Test {
 
@@ -70,6 +71,7 @@ public class AMQ5212Test {
         ((KahaDBPersistenceAdapter)brokerService.getPersistenceAdapter()).setConcurrentStoreAndDispatchQueues(concurrentStoreAndDispatchQ);
         brokerService.addConnector("tcp://localhost:0");
         brokerService.setAdvisorySupport(false);
+        brokerService.getManagementContext().setCreateConnector(false);
         brokerService.start();
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/5667e4dd/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5274Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5274Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5274Test.java
index 4ba6526..dd0c4d3 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5274Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5274Test.java
@@ -16,13 +16,18 @@
  */
 package org.apache.activemq.bugs;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.concurrent.TimeUnit;
+
 import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
+
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.RedeliveryPolicy;
@@ -38,21 +43,18 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 public class AMQ5274Test {
-    static Logger LOG = LoggerFactory.getLogger(AMQ5274Test.class);
-    String activemqURL;
-    BrokerService brokerService;
-    ActiveMQQueue dest = new ActiveMQQueue("TestQ");
+    private static Logger LOG = LoggerFactory.getLogger(AMQ5274Test.class);
 
+    private String activemqURL;
+    private BrokerService brokerService;
+    private final ActiveMQQueue dest = new ActiveMQQueue("TestQ");
 
     @Before
     public void startBroker() throws Exception {
         brokerService = new BrokerService();
         brokerService.setPersistent(false);
+        brokerService.getManagementContext().setCreateConnector(false);
         PolicyMap policyMap = new PolicyMap();
         PolicyEntry defaultPolicy = new PolicyEntry();
         defaultPolicy.setExpireMessagesPeriod(1000);
@@ -91,7 +93,7 @@ public class AMQ5274Test {
         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
         MessageConsumer consumer = session.createConsumer(dest);
         Message m;
-        while ( (m = consumer.receive(4000)) != null) {
+        while ((m = consumer.receive(4000)) != null) {
             LOG.info("Got:" + m);
             TimeUnit.SECONDS.sleep(1);
             session.rollback();
@@ -106,26 +108,26 @@ public class AMQ5274Test {
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = session.createProducer(dest);
         producer.setTimeToLive(10000);
-        for (int i=0;i<20;i++) {
-            producer.send(session.createTextMessage("i="+i));
+        for (int i = 0; i < 20; i++) {
+            producer.send(session.createTextMessage("i=" + i));
         }
-       connection.close();
+        connection.close();
     }
 
     private ActiveMQConnection createConnection() throws JMSException {
         return (ActiveMQConnection) new ActiveMQConnectionFactory(activemqURL).createConnection();
     }
 
-
     public long getQueueSize() throws Exception {
         long queueSize = 0;
         try {
-            QueueViewMBean queueViewMBean = (QueueViewMBean) brokerService.getManagementContext().newProxyInstance(BrokerMBeanSupport.createDestinationName(brokerService.getBrokerObjectName(),
dest), QueueViewMBean.class, false);
+            QueueViewMBean queueViewMBean = (QueueViewMBean) brokerService.getManagementContext().newProxyInstance(
+                BrokerMBeanSupport.createDestinationName(brokerService.getBrokerObjectName(),
dest), QueueViewMBean.class, false);
             queueSize = queueViewMBean.getQueueSize();
             LOG.info("QueueSize for destination {} is {}", dest, queueSize);
         } catch (Exception ex) {
-           LOG.error("Error retrieving QueueSize from JMX ", ex);
-           throw ex;
+            LOG.error("Error retrieving QueueSize from JMX ", ex);
+            throw ex;
         }
         return queueSize;
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5667e4dd/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5421Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5421Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5421Test.java
index 751d488..5259132 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5421Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5421Test.java
@@ -75,6 +75,7 @@ public class AMQ5421Test {
         policy.setTopicPrefetch(10);
         PolicyMap pMap = new PolicyMap();
         pMap.setDefaultEntry(policy);
+        brokerService.setUseJmx(false);
         brokerService.setDestinationPolicy(pMap);
         brokerService.addConnector("tcp://0.0.0.0:0");
         brokerService.start();


Mime
View raw message