activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [47/55] [abbrv] activemq-artemis git commit: Fix SimpleOpenWireTest
Date Wed, 07 Dec 2016 18:18:50 GMT
Fix SimpleOpenWireTest

Fix Joram tests

Fix JMSFailoverTest

Fix ResourceLimitTest and default queue creation to non-durable

Fix AddressConfigTest

Fix checkstyle


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

Branch: refs/heads/ARTEMIS-780
Commit: 9e709a3ebe7549a51aa4136a2d3d9ab33b065cc8
Parents: 351b8e5
Author: jbertram <jbertram@apache.com>
Authored: Wed Nov 30 08:19:32 2016 -0600
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Dec 7 13:16:36 2016 -0500

----------------------------------------------------------------------
 .../artemis/core/client/impl/ClientSessionImpl.java  |  2 +-
 .../activemq/artemis/jms/client/ActiveMQMessage.java |  1 -
 .../codec/PersistentAddressBindingEncoding.java      |  4 ++++
 .../artemis/core/server/impl/ActiveMQServerImpl.java | 15 +++++++--------
 .../integration/addressing/AddressConfigTest.java    |  2 +-
 .../integration/jms/cluster/JMSFailoverTest.java     |  7 ++++---
 .../integration/openwire/SimpleOpenWireTest.java     |  3 ++-
 .../tests/integration/server/ResourceLimitTest.java  |  2 +-
 .../activemq/artemis/common/AbstractAdmin.java       |  2 +-
 9 files changed, 21 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
index dd10e5b..f1b9cef 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
@@ -535,7 +535,7 @@ public final class ClientSessionImpl implements ClientSessionInternal,
FailureLi
                           queueName,
                           routingType,
                           null,
-                          true,
+                          false,
                           false,
                           ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
                           ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(),

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java
b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java
index 4f0be81..e558197 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java
@@ -44,7 +44,6 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
 import org.apache.activemq.artemis.core.message.impl.MessageInternal;
-import org.apache.activemq.artemis.core.server.RoutingType;
 import org.apache.activemq.artemis.reader.MessageUtil;
 import org.apache.activemq.artemis.utils.UUID;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
index c3aa9de..9684481 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
@@ -48,6 +48,10 @@ public class PersistentAddressBindingEncoding implements EncodingSupport,
Addres
       for (RoutingType routingType : routingTypes) {
          sb.append(routingType.toString() + ",");
       }
+      if (sb.charAt(sb.length() - 1) == ',') {
+         sb.deleteCharAt(sb.length() - 1);
+      }
+      sb.append("}");
       sb.append(", autoCreated=" + autoCreated + "]");
       return sb.toString();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 06852ce..2208cec 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2314,16 +2314,16 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       recoverStoredConfigs();
 
+      Map<Long, AddressBindingInfo> addressBindingInfosMap = new HashMap<>();
+
+      journalLoader.initAddresses(addressBindingInfosMap, addressBindingInfos);
+
       Map<Long, QueueBindingInfo> queueBindingInfosMap = new HashMap<>();
 
       journalLoader.initQueues(queueBindingInfosMap, queueBindingInfos);
 
       journalLoader.handleGroupingBindings(groupingInfos);
 
-      Map<Long, AddressBindingInfo> addressBindingInfosMap = new HashMap<>();
-
-      journalLoader.initAddresses(addressBindingInfosMap, addressBindingInfos);
-
       Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap = new
HashMap<>();
 
       HashSet<Pair<Long, Long>> pendingLargeMessages = new HashSet<>();
@@ -2473,10 +2473,12 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       defaultAddressInfo.addRoutingType(routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType()
: routingType);
       AddressInfo info = postOffice.getAddressInfo(addressName);
 
+      boolean addressAlreadyExists = true;
+
       if (info == null) {
          if (autoCreateAddress) {
             postOffice.addAddressInfo(defaultAddressInfo.setAutoCreated(true));
-            info = postOffice.getAddressInfo(addressName);
+            addressAlreadyExists = false;
          } else {
             throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);
          }
@@ -2486,12 +2488,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
 
       final Queue queue = queueFactory.createQueueWith(queueConfig);
 
-      boolean addressAlreadyExists = true;
-
       AddressInfo addressInfo = postOffice.getAddressInfo(queue.getAddress());
       if (addressInfo == null) {
          postOffice.addAddressInfo(new AddressInfo(queue.getAddress()));
-         addressAlreadyExists = false;
       } else {
          if (!addressInfo.getRoutingTypes().contains(routingType)) {
             throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeForAddress(routingType,
addressInfo.getName().toString(), addressInfo.getRoutingTypes());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java
index 4e3f689..0beaab7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java
@@ -52,6 +52,6 @@ public class AddressConfigTest extends ActiveMQTestBase {
 
       Set<RoutingType> routingTypeSet = new HashSet<>();
       routingTypeSet.add(RoutingType.MULTICAST);
-      assertEquals(RoutingType.MULTICAST, addressInfo.getRoutingTypes());
+      assertEquals(routingTypeSet, addressInfo.getRoutingTypes());
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
index 6e960f2..9fa9ac4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java
@@ -51,6 +51,7 @@ import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.NodeManager;
+import org.apache.activemq.artemis.core.server.RoutingType;
 import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQSession;
@@ -198,7 +199,7 @@ public class JMSFailoverTest extends ActiveMQTestBase {
 
       SimpleString jmsQueueName = new SimpleString("myqueue");
 
-      coreSession.createQueue(jmsQueueName, jmsQueueName, null, true);
+      coreSession.createQueue(jmsQueueName, RoutingType.ANYCAST, jmsQueueName, null, true);
 
       Queue queue = sess.createQueue("myqueue");
 
@@ -271,7 +272,7 @@ public class JMSFailoverTest extends ActiveMQTestBase {
 
       SimpleString jmsQueueName = new SimpleString("myqueue");
 
-      coreSessionLive.createQueue(jmsQueueName, jmsQueueName, null, true);
+      coreSessionLive.createQueue(jmsQueueName, RoutingType.ANYCAST, jmsQueueName, null,
true);
 
       Queue queue = sessLive.createQueue("myqueue");
 
@@ -377,7 +378,7 @@ public class JMSFailoverTest extends ActiveMQTestBase {
          }
       };
 
-      coreSession.createQueue(QUEUE, QUEUE, true);
+      coreSession.createQueue(QUEUE, RoutingType.ANYCAST, QUEUE, true);
 
       Queue queue = sess.createQueue("somequeue");
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
index 4fccfa3..a6bb55f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
@@ -49,6 +49,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.core.postoffice.PostOffice;
 import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
+import org.apache.activemq.artemis.core.server.RoutingType;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.command.ActiveMQTopic;
@@ -692,7 +693,7 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
       Connection conn1 = null;
 
       SimpleString durableQueue = new SimpleString("exampleQueue");
-      this.server.createQueue(durableQueue, durableQueue, null, true, false);
+      this.server.createQueue(durableQueue, RoutingType.ANYCAST, durableQueue, null, true,
false);
 
       Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
index a672bb1..2e77bb9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ResourceLimitTest.java
@@ -59,7 +59,7 @@ public class ResourceLimitTest extends ActiveMQTestBase {
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
       securityManager.getConfiguration().addUser("myUser", "password");
       securityManager.getConfiguration().addRole("myUser", "arole");
-      Role role = new Role("arole", false, false, false, false, true, true, false, true,
false, false);
+      Role role = new Role("arole", false, false, false, false, true, true, false, true,
false, true);
       Set<Role> roles = new HashSet<>();
       roles.add(role);
       server.getSecurityRepository().addMatch("#", roles);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e709a3e/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java
----------------------------------------------------------------------
diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java
b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java
index 2ada3be..bcff21b 100644
--- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java
+++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java
@@ -149,7 +149,7 @@ public class AbstractAdmin implements Admin {
    @Override
    public void createTopic(final String name) {
       try {
-         invokeSyncOperation(ResourceNames.BROKER, "createAddress", name, new Object[]{"MULTICAST"});
+         invokeSyncOperation(ResourceNames.BROKER, "createAddress", name, "MULTICAST");
       } catch (Exception e) {
          throw new IllegalStateException(e);
       }


Mime
View raw message