activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [37/48] activemq-artemis git commit: Fix StompV12Test
Date Wed, 23 Nov 2016 17:43:38 GMT
Fix StompV12Test


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

Branch: refs/heads/ARTEMIS-780
Commit: 47e5a665a2539b4778eec809d8eb42b94a92ad8c
Parents: 9012c9c
Author: jbertram <jbertram@apache.com>
Authored: Tue Nov 22 08:19:34 2016 -0600
Committer: jbertram <jbertram@apache.com>
Committed: Wed Nov 23 09:04:36 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/protocol/stomp/StompConnection.java     | 11 ++++++++---
 .../tests/integration/stomp/v12/StompV12Test.java        |  3 ++-
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/47e5a665/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
index 356aae1..52d3f3b 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
@@ -250,6 +250,7 @@ public final class StompConnection implements RemotingConnection {
       return res;
    }
 
+   // TODO this should take a type - send or receive so it knows whether to check the address
or the queue
    public void checkDestination(String destination) throws ActiveMQStompException {
       if (!manager.destinationExists(destination)) {
          throw BUNDLE.destinationNotExist(destination).setHandler(frameHandler);
@@ -262,11 +263,15 @@ public final class StompConnection implements RemotingConnection {
       try {
          if (manager.getServer().getAddressInfo(SimpleString.toSimpleString(queue)) == null)
{
             // TODO check here to see if auto-creation is enabled
-            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST))
{
+            if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST)
&& manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateAddresses())
{
                manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setAutoCreated(true));
             } else {
-               manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
-               manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue),
null, null, true, false, true);
+               if (manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateAddresses())
{
+                  manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
+               }
+               if (manager.getServer().getAddressSettingsRepository().getMatch(queue).isAutoCreateQueues())
{
+                  manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue),
null, null, true, false, true);
+               }
             }
             result = true;
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/47e5a665/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
index d30ba53..e1281e6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
@@ -354,7 +354,8 @@ public class StompV12Test extends StompTestBase {
    @Test
    public void testHeaderRepetitive() throws Exception {
       AddressSettings addressSettings = new AddressSettings();
-      addressSettings.setAutoCreateJmsQueues(false);
+      addressSettings.setAutoCreateQueues(false);
+      addressSettings.setAutoCreateAddresses(false);
       server.getActiveMQServer().getAddressSettingsRepository().addMatch("#", addressSettings);
 
       conn.connect(defUser, defPass);


Mime
View raw message