Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C9B54200BE5 for ; Fri, 9 Dec 2016 20:48:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C88FB160B1D; Fri, 9 Dec 2016 19:48:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BA287160B40 for ; Fri, 9 Dec 2016 20:48:48 +0100 (CET) Received: (qmail 90632 invoked by uid 500); 9 Dec 2016 19:48:47 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 88906 invoked by uid 99); 9 Dec 2016 19:48:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2016 19:48:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 44B86F0DCA; Fri, 9 Dec 2016 19:48:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Fri, 09 Dec 2016 19:49:09 -0000 Message-Id: <7461f60fe1bc4b469b9b17deb5ab095f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [25/50] [abbrv] activemq-artemis git commit: ARTEMIS-789 Fix various failing tests due to addressing changes archived-at: Fri, 09 Dec 2016 19:48:51 -0000 http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java b/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java index 702fe41..da47577 100644 --- a/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java +++ b/examples/features/standard/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java @@ -46,7 +46,7 @@ public class LargeMessageExample { * This may take some considerable time to create, send and consume - if it takes too long or you * don't have enough disk space just reduce the file size here */ - private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 2 GiB message + private static final long FILE_SIZE = 2L;// * 1024 * 1024 * 1024; // 2 GiB message public static void main(final String[] args) throws Exception { Process server = null; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml index 267d8c9..18eb207 100644 --- a/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/last-value-queue/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. - + @@ -58,7 +58,7 @@ under the License. - + true http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml index 279f2d2..e74c8bb 100644 --- a/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/management-notifications/src/main/resources/activemq/server0/broker.xml @@ -41,7 +41,7 @@ under the License. ./data/messaging/paging - jms.topic.notificationsTopic + notificationsTopic @@ -52,7 +52,7 @@ under the License. - + @@ -62,7 +62,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java b/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java index f1ceb3a..a463a13 100644 --- a/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java +++ b/examples/features/standard/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java @@ -30,6 +30,8 @@ import javax.naming.InitialContext; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper; +import org.apache.activemq.artemis.api.core.management.ResourceNames; +import org.apache.activemq.artemis.api.core.FilterConstants; /** * An example that shows how to manage ActiveMQ Artemis using JMS messages. @@ -81,7 +83,7 @@ public class ManagementExample { // Step 13. Use a helper class to fill the JMS message with management information: // * the name of the resource to manage // * in this case, we want to retrieve the value of the messageCount of the queue - JMSManagementHelper.putAttribute(m, "exampleQueue", "messageCount"); + JMSManagementHelper.putAttribute(m, ResourceNames.QUEUE + "exampleQueue", "messageCount"); // Step 14. Use the requestor to send the request and wait for the reply Message reply = requestor.request(m); @@ -97,7 +99,7 @@ public class ManagementExample { // * the object name of the resource to manage (i.e. the queue) // * in this case, we want to call the "removeMessage" operation with the JMS MessageID // of the message sent to the queue in step 8. - JMSManagementHelper.putOperationInvocation(m, "exampleQueue", "removeMessage", message.getJMSMessageID()); + JMSManagementHelper.putOperationInvocation(m, ResourceNames.QUEUE + "exampleQueue", "removeMessages", FilterConstants.ACTIVEMQ_USERID + " = '" + message.getJMSMessageID() + "'"); // Step 18 Use the requestor to send the request and wait for the reply reply = requestor.request(m); @@ -107,8 +109,8 @@ public class ManagementExample { System.out.println("operation invocation has succeeded: " + success); // Step 20. Use a helper class to retrieve the operation result - // in that case, a boolean which is true if the message was removed, false else - boolean messageRemoved = (Boolean) JMSManagementHelper.getResult(reply); + // in that case, a long which is 1 if the message was removed, 0 else + boolean messageRemoved = 1 == (long) JMSManagementHelper.getResult(reply); System.out.println("message has been removed: " + messageRemoved); // Step 21. Create a JMS Message Consumer on the queue http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml index dc62e6f..218e621 100644 --- a/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/management/src/main/resources/activemq/server0/broker.xml @@ -38,7 +38,7 @@ under the License. ./data/messaging/paging - jms.queue.activemq.management + activemq.management @@ -48,7 +48,7 @@ under the License. - + @@ -58,12 +58,12 @@ under the License. - + - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml index f946982..39bba47 100644 --- a/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/message-counters/src/main/resources/activemq/server0/broker.xml @@ -55,7 +55,7 @@ under the License. - + @@ -65,7 +65,7 @@ under the License. - + @@ -77,8 +77,8 @@ under the License. - - jms.queue.expiryQueue + + expiryQueue http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml index 04c77c4..1da9ff5 100644 --- a/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/paging/src/main/resources/activemq/server0/broker.xml @@ -54,7 +54,7 @@ under the License. - + @@ -63,7 +63,7 @@ under the License. - + @@ -74,12 +74,12 @@ under the License. - + 100000 20000 - + 10485760 1048576 http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java b/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java index 8a3fe10..d840c32 100644 --- a/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java +++ b/examples/features/standard/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java @@ -31,6 +31,7 @@ import javax.jms.TextMessage; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants; import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper; +import org.apache.activemq.artemis.api.core.management.ResourceNames; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; /** @@ -113,7 +114,7 @@ public class PreacknowledgeExample { Message m = session.createMessage(); - JMSManagementHelper.putAttribute(m, "exampleQueue", "messageCount"); + JMSManagementHelper.putAttribute(m, ResourceNames.QUEUE + "exampleQueue", "messageCount"); Message response = requestor.request(m); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml index 4379ab8..c13644b 100644 --- a/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/pre-acknowledge/src/main/resources/activemq/server0/broker.xml @@ -45,7 +45,7 @@ under the License. - + @@ -54,7 +54,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml index 612b35b..64a5ba3 100644 --- a/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/queue-requestor/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. - + @@ -55,7 +55,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml index f646990..ec41710 100644 --- a/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/reattach-node/src/main/resources/activemq/server0/broker.xml @@ -61,7 +61,7 @@ under the License. - + @@ -70,7 +70,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml index 667ac95..bb96922 100644 --- a/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/security-ldap/src/main/resources/activemq/server0/broker.xml @@ -52,7 +52,7 @@ under the License. - + @@ -61,7 +61,7 @@ under the License. - + @@ -70,7 +70,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml index e2dc187..28612c4 100644 --- a/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/security/src/main/resources/activemq/server0/broker.xml @@ -49,7 +49,7 @@ under the License. - + @@ -58,7 +58,7 @@ under the License. - + @@ -67,7 +67,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml index 14fa849..438a751 100644 --- a/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/ssl-enabled-dual-authentication/src/main/resources/activemq/server0/broker.xml @@ -47,7 +47,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml index 4bf6371..1b209d8 100644 --- a/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/ssl-enabled/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml index 59ce149..e9cde42 100644 --- a/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/static-selector/src/main/resources/activemq/server0/broker.xml @@ -43,8 +43,8 @@ under the License. - -
jms.queue.exampleQueue
+ +
exampleQueue
@@ -53,7 +53,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml index 2dd2df9..15fd199 100644 --- a/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/temp-queue/src/main/resources/activemq/server0/broker.xml @@ -45,7 +45,7 @@ under the License. - + @@ -54,7 +54,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml index d45eb5d..030aa73 100644 --- a/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/topic-selector-example1/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml index d45eb5d..030aa73 100644 --- a/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/topic-selector-example2/src/main/resources/activemq/server0/broker.xml @@ -46,7 +46,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml index fd6671c..25d82da 100644 --- a/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/standard/topic/src/main/resources/activemq/server0/broker.xml @@ -45,9 +45,11 @@ under the License. - + + + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml b/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml index 1095761..3751be0 100644 --- a/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml +++ b/examples/features/sub-modules/aerogear/src/main/resources/activemq/server0/broker.xml @@ -45,8 +45,8 @@ under the License. - -
jms.queue.exampleQueue
+ +
exampleQueue
@@ -54,7 +54,7 @@ under the License. org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory - + @@ -64,7 +64,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java ---------------------------------------------------------------------- diff --git a/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java b/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java index a166dc2..0c389f4 100644 --- a/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java +++ b/examples/protocols/amqp/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java @@ -30,6 +30,7 @@ import javax.naming.InitialContext; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper; +import org.apache.activemq.artemis.api.core.management.ResourceNames; /** * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where @@ -107,7 +108,7 @@ public class ProtonCPPExample { Message m = session.createMessage(); - JMSManagementHelper.putAttribute(m, "exampleQueue", "messageCount"); + JMSManagementHelper.putAttribute(m, ResourceNames.QUEUE + "exampleQueue", "messageCount"); Message response = requestor.request(m); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml ---------------------------------------------------------------------- diff --git a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml index 14fa849..438a751 100644 --- a/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml +++ b/examples/protocols/stomp/stomp-dual-authentication/src/main/resources/activemq/server0/broker.xml @@ -47,7 +47,7 @@ under the License. - + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java index 827e1b3..69d8675 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java @@ -229,7 +229,7 @@ public class AddressingTest extends ActiveMQTestBase { SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); // For each address, create 2 Queues with the same address, assert both queues receive message boolean deleteOnNoConsumers = true; - Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false); + Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, true); ClientSession session = sessionFactory.createSession(); session.start(); @@ -246,7 +246,7 @@ public class AddressingTest extends ActiveMQTestBase { SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); // For each address, create 2 Queues with the same address, assert both queues receive message boolean deleteOnNoConsumers = false; - Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, false); + Queue q1 = server.createQueue(address, queueName, null, true, false, null, deleteOnNoConsumers, true); ClientSession session = sessionFactory.createSession(); session.start(); @@ -263,7 +263,7 @@ public class AddressingTest extends ActiveMQTestBase { SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); // For each address, create 2 Queues with the same address, assert both queues receive message boolean deleteOnNoConsumers = false; - Queue q1 = server.createQueue(address, queueName, null, true, false, 0, deleteOnNoConsumers, false); + Queue q1 = server.createQueue(address, queueName, null, true, false, 0, deleteOnNoConsumers, true); Exception expectedException = null; String expectedMessage = "Maximum Consumer Limit Reached on Queue"; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java index d961a71..1e12d4c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java @@ -86,7 +86,7 @@ public class AmqpClientTestSupport extends ActiveMQTestBase { ActiveMQServer server = createServer(true, true); serverManager = new JMSServerManagerImpl(server); Configuration serverConfig = server.getConfiguration(); - serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); + serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(true).setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); serverConfig.setSecurityEnabled(false); serverManager.start(); server.start(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java index 9589f47..4fceaef 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java @@ -18,7 +18,6 @@ package org.apache.activemq.artemis.tests.integration.cli; import java.io.ByteArrayOutputStream; import java.io.PrintStream; -import java.util.UUID; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.cli.commands.AbstractAction; @@ -26,10 +25,7 @@ import org.apache.activemq.artemis.cli.commands.ActionContext; import org.apache.activemq.artemis.cli.commands.address.CreateAddress; import org.apache.activemq.artemis.cli.commands.address.DeleteAddress; import org.apache.activemq.artemis.cli.commands.address.ShowAddress; -import org.apache.activemq.artemis.cli.commands.queue.CreateQueue; -import org.apache.activemq.artemis.cli.commands.queue.DeleteQueue; import org.apache.activemq.artemis.core.config.DivertConfiguration; -import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.Before; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java index 5d7a695..9bddb8c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java @@ -51,7 +51,7 @@ public class QueueCommandTest extends JMSTestBase { CreateQueue command = new CreateQueue(); command.setName(queueName); command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error))); - checkExecutionFailure(command, "AMQ119203: Address Does Not Exist:");; + checkExecutionFailure(command, "AMQ119203: Address Does Not Exist:"); assertFalse(server.queueQuery(new SimpleString(queueName)).isExists()); } @@ -74,7 +74,7 @@ public class QueueCommandTest extends JMSTestBase { @Test public void testCreateCoreQueueAddressExists() throws Exception { String queueName = "queue"; - String address= "address"; + String address = "address"; CreateQueue command = new CreateQueue(); command.setName(queueName); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java index 006bef1..a980878 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java @@ -114,7 +114,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addUser("guest", "guest"); ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().setDefaultUser("guest"); ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addRole("guest", "rejectAll"); - Role role = new Role("rejectAll", false, false, false, false, false, false, false, false, false); + Role role = new Role("rejectAll", false, false, false, false, false, false, false, false, false, false); Set roles = new HashSet<>(); roles.add(role); server.getSecurityRepository().addMatch("#", roles); @@ -249,7 +249,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addUser("guest", "guest"); ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().setDefaultUser("guest"); ((ActiveMQJAASSecurityManager) server.getSecurityManager()).getConfiguration().addRole("guest", "allowAll"); - Role role = new Role("allowAll", true, true, true, true, true, true, true, true, true); + Role role = new Role("allowAll", true, true, true, true, true, true, true, true, true, true); Set roles = new HashSet<>(); roles.add(role); server.getSecurityRepository().addMatch("#", roles); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java index 7f97100..b3c7a4c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java @@ -229,7 +229,8 @@ public class SessionTest extends ActiveMQTestBase { @Test public void testQueueQueryNoQ() throws Exception { - server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false)); + server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false)); + server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false)); cf = createSessionFactory(locator); ClientSession clientSession = cf.createSession(false, true, true); QueueQuery resp = clientSession.queueQuery(new SimpleString(queueName)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java index abfc093..746b31d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java @@ -103,7 +103,7 @@ public class SecurityFailoverTest extends FailoverTest { protected ActiveMQJAASSecurityManager installSecurity(TestableServer server) { ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getServer().getSecurityManager(); securityManager.getConfiguration().addUser("a", "b"); - Role role = new Role("arole", true, true, true, true, true, true, true, true, true); + Role role = new Role("arole", true, true, true, true, true, true, true, true, true, true); Set roles = new HashSet<>(); roles.add(role); server.getServer().getSecurityRepository().addMatch("#", roles); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java index 1a0a997..5aafd91 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToOpenwireTest.java @@ -64,7 +64,7 @@ public class AMQPToOpenwireTest extends ActiveMQTestBase { server.waitForActivation(10, TimeUnit.SECONDS); Configuration serverConfig = server.getConfiguration(); - serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); + serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); serverConfig.setSecurityEnabled(false); coreQueue = new SimpleString(queueName); server.createQueue(coreQueue, coreQueue, null, false, false); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java index fc98f13..968a3a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java @@ -55,7 +55,7 @@ public class OpenWireToAMQPTest extends ActiveMQTestBase { super.setUp(); server = createServer(true, true); Configuration serverConfig = server.getConfiguration(); - serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateJmsQueues(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); + serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ"))); serverConfig.setSecurityEnabled(false); server.start(); coreQueue = new SimpleString(queueName); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java index 362c8a1..f6ad723 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java @@ -64,8 +64,6 @@ public class InterceptorTest extends ActiveMQTestBase { private final SimpleString QUEUE = new SimpleString("InterceptorTestQueue"); - private final SimpleString JMS_QUEUE = SimpleString.toSimpleString(QUEUE.toString()); - private ServerLocator locator; @Override @@ -103,12 +101,12 @@ public class InterceptorTest extends ActiveMQTestBase { @Override public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException { - if (packet.getType() == PacketImpl.CREATE_QUEUE) { + if (packet.getType() == PacketImpl.CREATE_QUEUE || packet.getType() == PacketImpl.CREATE_QUEUE_V2) { String userName = getUsername(packet, connection); CreateQueueMessage createQueue = (CreateQueueMessage) packet; createQueue.setFilterString(new SimpleString("userName='" + userName + "'")); - System.out.println("userName = " + userName); + System.out.println("userName on createQueue = " + userName); } else if (packet.getType() == PacketImpl.SESS_SEND) { String userName = getUsername(packet, connection); MessagePacket msgPacket = (MessagePacket) packet; @@ -1054,7 +1052,7 @@ public class InterceptorTest extends ActiveMQTestBase { public void testInterceptorOnURI() throws Exception { locator.close(); - server.createQueue(JMS_QUEUE, JMS_QUEUE, null, true, false); + server.createQueue(QUEUE, QUEUE, null, true, false); String uri = "tcp://localhost:61616?incomingInterceptorList=" + Incoming.class.getCanonicalName() + "&outgoingInterceptorList=" + Outgoing.class.getName(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java index eb3d184..2894c29 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/AutoCreateQueueClusterTest.java @@ -46,8 +46,8 @@ public class AutoCreateQueueClusterTest extends JMSClusteredTestBase { @Test public void testAutoCreate() throws Exception { - server1.getAddressSettingsRepository().getMatch("#").setAutoCreateJmsQueues(true).setRedistributionDelay(0); - server2.getAddressSettingsRepository().getMatch("#").setAutoCreateJmsQueues(true).setRedistributionDelay(0); + server1.getAddressSettingsRepository().getMatch("#").setAutoCreateQueues(true).setAutoCreateAddresses(true).setRedistributionDelay(0); + server2.getAddressSettingsRepository().getMatch("#").setAutoCreateQueues(true).setAutoCreateAddresses(true).setRedistributionDelay(0); Connection conn1 = cf1.createConnection(); Connection conn2 = cf2.createConnection(); conn1.start(); @@ -58,15 +58,13 @@ public class AutoCreateQueueClusterTest extends JMSClusteredTestBase { Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE); - // TODO the "jms." prefix is required here because the cluster connection only works for queues which start with "jms" - MessageProducer prod1 = session1.createProducer(ActiveMQJMSClient.createQueue("jms.myQueue")); + MessageProducer prod1 = session1.createProducer(ActiveMQJMSClient.createQueue("myQueue")); prod1.setDeliveryMode(DeliveryMode.PERSISTENT); prod1.send(session1.createTextMessage("m1")); - // TODO the "jms." prefix is required here because the cluster connection only works for queues which start with "jms" - MessageConsumer cons2 = session2.createConsumer(ActiveMQJMSClient.createQueue("jms.myQueue")); + MessageConsumer cons2 = session2.createConsumer(ActiveMQJMSClient.createQueue("myQueue")); TextMessage received = (TextMessage) cons2.receive(5000); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java index b68d803..ae3a93a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java @@ -28,7 +28,7 @@ import org.junit.Test; public class TemporaryQueueClusterTest extends JMSClusteredTestBase { - public static final String QUEUE_NAME = "jms.target"; + public static final String QUEUE_NAME = "target"; // Constants ----------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java index 64d2af3..64edd29 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/NonExistentQueueTest.java @@ -40,8 +40,8 @@ public class NonExistentQueueTest extends JMSTestBase { @Test public void sendToNonExistentDestination() throws Exception { - server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsQueues(false)); - server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateJmsTopics(false)); + server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false)); + server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(false)); Destination destination = ActiveMQJMSClient.createTopic("DoesNotExist"); TransportConfiguration transportConfiguration = new TransportConfiguration(InVMConnectorFactory.class.getName()); ConnectionFactory localConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java index 681c258..c4a388e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java @@ -440,7 +440,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { String exactAddress = "test.whatever"; assertEquals(1, serverControl.getRoles(addressMatch).length); - serverControl.addSecuritySettings(addressMatch, "foo", "foo, bar", "foo", "bar", "foo, bar", "", "", "bar", "foo"); + serverControl.addSecuritySettings(addressMatch, "foo", "foo, bar", "foo", "bar", "foo, bar", "", "", "bar", "foo", "foo"); // Restart the server. Those settings should be persisted @@ -1416,7 +1416,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { server.start(); HashSet role = new HashSet<>(); - role.add(new Role("guest", true, true, true, true, true, true, true, true, true)); + role.add(new Role("guest", true, true, true, true, true, true, true, true, true, true)); server.getSecurityRepository().addMatch("#", role); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java index 2547bb6..931089c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java @@ -16,12 +16,13 @@ */ package org.apache.activemq.artemis.tests.integration.management; +import java.util.Map; + import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException; import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl; import org.apache.activemq.artemis.api.core.management.Parameter; import org.apache.activemq.artemis.api.core.management.ResourceNames; - -import java.util.Map; +import org.apache.activemq.artemis.core.settings.impl.AddressSettings; public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTest { @@ -607,8 +608,9 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes String deleteNonDurableQueueRoles, String manageRoles, String browseRoles, - String createAddress) throws Exception { - proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddress); + String createAddress, + String deleteAddress) throws Exception { + proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddress, deleteAddress); } @Override @@ -649,7 +651,37 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes @Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues, @Parameter(desc = "allow topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics, @Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics) throws Exception { - proxy.invokeOperation("addAddressSettings", addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics); + addAddressSettings(addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics, AddressSettings.DEFAULT_AUTO_CREATE_QUEUES, AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES); + } + + @Override + public void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch, + @Parameter(desc = "the dead letter address setting", name = "DLA") String DLA, + @Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress, + @Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay, + @Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue, + @Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts, + @Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes, + @Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes, + @Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize, + @Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay, + @Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier, + @Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay, + @Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay, + @Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute, + @Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy, + @Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold, + @Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod, + @Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy, + @Parameter(desc = "allow jms queues to be created automatically", name = "autoCreateJmsQueues") boolean autoCreateJmsQueues, + @Parameter(desc = "allow auto-created jms queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues, + @Parameter(desc = "allow jms topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics, + @Parameter(desc = "allow auto-created jms topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics, + @Parameter(desc = "allow queues to be created automatically", name = "autoCreateQueues") boolean autoCreateQueues, + @Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteQueues") boolean autoDeleteQueues, + @Parameter(desc = "allow topics to be created automatically", name = "autoCreateAddresses") boolean autoCreateAddresses, + @Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteAddresses") boolean autoDeleteAddresses) throws Exception { + proxy.invokeOperation("addAddressSettings", addressMatch, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics, autoCreateQueues, autoDeleteQueues, autoCreateAddresses, autoDeleteAddresses); } @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java index 9a2ec1e..35e1aa2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java @@ -117,7 +117,7 @@ public class AddressControlTest extends ManagementTestBase { public void testGetRoles() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); SimpleString queue = RandomUtil.randomSimpleString(); - Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean()); + Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean()); session.createQueue(address, queue, true); @@ -148,7 +148,7 @@ public class AddressControlTest extends ManagementTestBase { public void testGetRolesAsJSON() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); SimpleString queue = RandomUtil.randomSimpleString(); - Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean()); + Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean()); session.createQueue(address, queue, true); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java index 1587cef..4b8e487 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlUsingCoreTest.java @@ -125,7 +125,7 @@ public class AddressControlUsingCoreTest extends ManagementTestBase { public void testGetRoles() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); SimpleString queue = RandomUtil.randomSimpleString(); - Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean()); + Role role = new Role(RandomUtil.randomString(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean(), RandomUtil.randomBoolean()); session.createQueue(address, queue, true); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java deleted file mode 100644 index 5c94f1d..0000000 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithStompTest.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.artemis.tests.integration.management; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.Map; - -import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; -import org.apache.activemq.artemis.api.core.SimpleString; -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.api.core.client.ClientSession; -import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; -import org.apache.activemq.artemis.api.core.client.ServerLocator; -import org.apache.activemq.artemis.api.core.management.ResourceNames; -import org.apache.activemq.artemis.core.config.Configuration; -import org.apache.activemq.artemis.core.protocol.stomp.Stomp; -import org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManagerFactory; -import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory; -import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; -import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.core.server.ActiveMQServers; -import org.apache.activemq.artemis.jms.server.JMSServerManager; -import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; -import org.apache.activemq.artemis.utils.RandomUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -public class ManagementWithStompTest extends ManagementTestBase { - - // Constants ----------------------------------------------------- - - // Attributes ---------------------------------------------------- - - protected ActiveMQServer server; - - protected JMSServerManager jmsServer; - - protected ClientSession session; - - private Socket stompSocket; - - private ByteArrayOutputStream inputBuffer; - - // Static -------------------------------------------------------- - - // Constructors -------------------------------------------------- - - // Public -------------------------------------------------------- - - @Test - public void testGetManagementAttributeFromStomp() throws Exception { - SimpleString address = RandomUtil.randomSimpleString(); - SimpleString queue = RandomUtil.randomSimpleString(); - - session.createQueue(address, queue, null, false); - - String frame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL; - sendFrame(frame); - - frame = receiveFrame(10000); - Assert.assertTrue(frame.startsWith("CONNECTED")); - - frame = "SUBSCRIBE\n" + "destination:" + queue + "\n\n" + Stomp.NULL; - sendFrame(frame); - - // retrieve the address of the queue - frame = "\nSEND\n" + "destination:" + ActiveMQDefaultConfiguration.getDefaultManagementAddress() + "\n" + - "reply-to:" + address + "\n" + - "_AMQ_ResourceName:" + ResourceNames.QUEUE + queue + "\n" + - "_AMQ_Attribute: Address\n\n" + - Stomp.NULL; - sendFrame(frame); - - frame = receiveFrame(10000); - System.out.println(frame); - Assert.assertTrue(frame.contains("_AMQ_OperationSucceeded:true")); - // the address will be returned in the message body in a JSON array - Assert.assertTrue(frame.contains("[\"" + address + "\"]")); - - frame = "UNSUBSCRIBE\n" + "destination:" + queue + "\n" + - "receipt: 123\n\n" + - Stomp.NULL; - sendFrame(frame); - waitForReceipt(); - - String disconnectFrame = "DISCONNECT\n\n" + Stomp.NULL; - sendFrame(disconnectFrame); - - session.deleteQueue(queue); - } - - @Test - public void testInvokeOperationFromStomp() throws Exception { - SimpleString address = RandomUtil.randomSimpleString(); - SimpleString queue = RandomUtil.randomSimpleString(); - - session.createQueue(address, queue, null, false); - - String frame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL; - sendFrame(frame); - - frame = receiveFrame(10000); - Assert.assertTrue(frame.startsWith("CONNECTED")); - - frame = "SUBSCRIBE\n" + "destination:" + queue + "\n\n" + Stomp.NULL; - sendFrame(frame); - - // count number of message with filter "color = 'blue'" - frame = "\nSEND\n" + "destination:" + ActiveMQDefaultConfiguration.getDefaultManagementAddress() + "\n" + - "reply-to:" + address + "\n" + - "_AMQ_ResourceName:" + ResourceNames.QUEUE + queue + "\n" + - "_AMQ_OperationName: countMessages\n\n" + - "[\"color = 'blue'\"]" + - Stomp.NULL; - sendFrame(frame); - - frame = receiveFrame(10000); - System.out.println(frame); - Assert.assertTrue(frame.contains("_AMQ_OperationSucceeded:true")); - // there is no such messages => 0 returned in a JSON array - Assert.assertTrue(frame.contains("[0]")); - - frame = "UNSUBSCRIBE\n" + "destination:" + queue + "\n" + - "receipt: 123\n\n" + - Stomp.NULL; - sendFrame(frame); - waitForReceipt(); - - String disconnectFrame = "DISCONNECT\n\n" + Stomp.NULL; - sendFrame(disconnectFrame); - - session.deleteQueue(queue); - } - - // Package protected --------------------------------------------- - - // Protected ----------------------------------------------------- - - private ServerLocator locator; - - @Override - @Before - public void setUp() throws Exception { - super.setUp(); - - Map params = new HashMap<>(); - params.put(TransportConstants.PROTOCOLS_PROP_NAME, StompProtocolManagerFactory.STOMP_PROTOCOL_NAME); - params.put(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_STOMP_PORT); - TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params); - - Configuration config = createDefaultInVMConfig().addAcceptorConfiguration(stompTransport); - - server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, false, "brianm", "wombats")); - - jmsServer = new JMSServerManagerImpl(server); - - jmsServer.start(); - - locator = createInVMNonHALocator().setBlockOnNonDurableSend(true); - ClientSessionFactory sf = createSessionFactory(locator); - session = sf.createSession(false, true, false); - session.start(); - - stompSocket = new Socket("127.0.0.1", TransportConstants.DEFAULT_STOMP_PORT); - inputBuffer = new ByteArrayOutputStream(); - } - - // Private ------------------------------------------------------- - - public void sendFrame(String data) throws Exception { - byte[] bytes = data.getBytes(StandardCharsets.UTF_8); - OutputStream outputStream = stompSocket.getOutputStream(); - for (int i = 0; i < bytes.length; i++) { - outputStream.write(bytes[i]); - } - outputStream.flush(); - } - - public String receiveFrame(long timeOut) throws Exception { - stompSocket.setSoTimeout((int) timeOut); - InputStream is = stompSocket.getInputStream(); - int c = 0; - for (;;) { - c = is.read(); - if (c < 0) { - throw new IOException("socket closed."); - } else if (c == 0) { - c = is.read(); - if (c != '\n') { - byte[] ba = inputBuffer.toByteArray(); - System.out.println(new String(ba, StandardCharsets.UTF_8)); - } - Assert.assertEquals("Expecting stomp frame to terminate with \0\n", c, '\n'); - byte[] ba = inputBuffer.toByteArray(); - inputBuffer.reset(); - return new String(ba, StandardCharsets.UTF_8); - } else { - inputBuffer.write(c); - } - } - } - - protected void waitForReceipt() throws Exception { - String frame = receiveFrame(50000); - Assert.assertNotNull(frame); - Assert.assertTrue(frame.indexOf("RECEIPT") > -1); - } - - // Inner classes ------------------------------------------------- - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java index 03c7fc7..bbe97ec 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java @@ -90,10 +90,10 @@ public class SecurityManagementWithConfiguredAdminUserTest extends SecurityManag securityManager.getConfiguration().addRole(invalidAdminUser, "guest"); Set adminRole = securityRepository.getMatch(ActiveMQDefaultConfiguration.getDefaultManagementAddress().toString()); - adminRole.add(new Role("admin", true, true, true, true, true, true, true, true, true)); + adminRole.add(new Role("admin", true, true, true, true, true, true, true, true, true, true)); securityRepository.addMatch(ActiveMQDefaultConfiguration.getDefaultManagementAddress().toString(), adminRole); Set guestRole = securityRepository.getMatch("*"); - guestRole.add(new Role("guest", true, true, true, true, true, true, false, true, true)); + guestRole.add(new Role("guest", true, true, true, true, true, true, false, true, true, true)); securityRepository.addMatch("*", guestRole); return server; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0861be14/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java index 89f03b8..a5f8ec5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java @@ -88,7 +88,7 @@ public class SecurityNotificationTest extends ActiveMQTestBase { SimpleString address = RandomUtil.randomSimpleString(); // guest can not create queue - Role role = new Role("roleCanNotCreateQueue", true, true, false, true, false, true, true, true, true); + Role role = new Role("roleCanNotCreateQueue", true, true, false, true, false, true, true, true, true, true); Set roles = new HashSet<>(); roles.add(role); server.getSecurityRepository().addMatch(address.toString(), roles); @@ -136,7 +136,7 @@ public class SecurityNotificationTest extends ActiveMQTestBase { securityManager.getConfiguration().addUser("guest", "guest"); securityManager.getConfiguration().setDefaultUser("guest"); - Role role = new Role("notif", true, true, true, true, true, true, true, true, true); + Role role = new Role("notif", true, true, true, true, true, true, true, true, true, true); Set roles = new HashSet<>(); roles.add(role); server.getSecurityRepository().addMatch(ActiveMQDefaultConfiguration.getDefaultManagementNotificationAddress().toString(), roles);