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 630C3200BC8 for ; Wed, 23 Nov 2016 18:43:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 61949160B1F; Wed, 23 Nov 2016 17:43:06 +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 5014E160B21 for ; Wed, 23 Nov 2016 18:43:05 +0100 (CET) Received: (qmail 51655 invoked by uid 500); 23 Nov 2016 17:43:04 -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 49777 invoked by uid 99); 23 Nov 2016 17:43:03 -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; Wed, 23 Nov 2016 17:43:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2A226F16B6; Wed, 23 Nov 2016 17:43:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jbertram@apache.org To: commits@activemq.apache.org Date: Wed, 23 Nov 2016 17:43:28 -0000 Message-Id: <54cfb4fe29ad456caaa2b193fcd2c021@git.apache.org> In-Reply-To: <8ee90db24df54d2ab8ee79e24b3991fc@git.apache.org> References: <8ee90db24df54d2ab8ee79e24b3991fc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [27/48] activemq-artemis git commit: Fix ArtemisTest failures archived-at: Wed, 23 Nov 2016 17:43:06 -0000 Fix ArtemisTest failures Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/edc947d4 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/edc947d4 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/edc947d4 Branch: refs/heads/ARTEMIS-780 Commit: edc947d4f31c0d099c7cdd46a50e97ad3c544fbd Parents: cf47a04 Author: jbertram Authored: Sat Nov 19 09:57:35 2016 -0600 Committer: jbertram Committed: Wed Nov 23 09:04:35 2016 -0600 ---------------------------------------------------------------------- .../activemq/artemis/cli/commands/Create.java | 37 +++++++++++++++----- .../artemis/cli/commands/etc/broker.xml | 2 +- .../apache/activemq/cli/test/ArtemisTest.java | 18 +++++----- .../core/server/impl/ActiveMQServerImpl.java | 3 +- 4 files changed, 40 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index 77a2e68..ae2734c 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -187,11 +187,11 @@ public class Create extends InputAbstract { @Option(name = "--no-web", description = "This will remove the web server definition from bootstrap.xml") boolean noWeb; - @Option(name = "--queues", description = "comma separated list of jms queues.") + @Option(name = "--queues", description = "comma separated list of queues.") String queues; - @Option(name = "--topics", description = "comma separated list of jms topics ") - String topics; + @Option(name = "--addresses", description = "comma separated list of addresses ") + String addresses; @Option(name = "--aio", description = "Force aio journal on the configuration regardless of the library being available or not.") boolean forceLibaio; @@ -616,7 +616,7 @@ public class Create extends InputAbstract { filters.put("${cluster-password}", ""); } - applyJMSObjects(filters); + applyAddressesAndQueues(filters); if (home != null) { filters.put("${home}", path(home, false)); @@ -768,12 +768,33 @@ public class Create extends InputAbstract { for (String str : getQueueList()) { printWriter.println(" "); } - for (String str : getTopicList()) { + for (String str : getAddressList()) { printWriter.println(" "); } filters.put("${jms-list.settings}", writer.toString()); } + /** + * It will create the address and queue configurations + */ + private void applyAddressesAndQueues(HashMap filters) { + StringWriter writer = new StringWriter(); + PrintWriter printWriter = new PrintWriter(writer); + printWriter.println(); + + for (String str : getQueueList()) { + printWriter.println("
"); + printWriter.println(" "); + printWriter.println(" "); + printWriter.println(" "); + printWriter.println("
"); + } + for (String str : getAddressList()) { + printWriter.println("
"); + } + filters.put("${address-queue.settings}", writer.toString()); + } + private void performAutoTune(HashMap filters, boolean aio, File dataFolder) { if (noAutoTune) { filters.put("${journal-buffer.settings}", ""); @@ -846,11 +867,11 @@ public class Create extends InputAbstract { } } - private String[] getTopicList() { - if (topics == null) { + private String[] getAddressList() { + if (addresses == null) { return new String[0]; } else { - return topics.split(","); + return addresses.split(","); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml ---------------------------------------------------------------------- diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml index 62a82ec..3b67a09 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml @@ -106,7 +106,7 @@ ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-st -
+ ${address-queue.settings} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java ---------------------------------------------------------------------- diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java index dd306e9..90f74ab 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java @@ -531,20 +531,20 @@ public class ArtemisTest { File instanceFolder = temporaryFolder.newFolder(folderName); setupAuth(instanceFolder); - String queues = "q1,t2"; - String topics = "t1,t2"; + String queues = "q1,q2"; + String addresses = "a1,a2"; // This is usually set when run from the command line via artemis.profile - Run.setEmbedded(false); - Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics, "--no-autotune", "--require-login"); + Run.setEmbedded(true); + Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--addresses", addresses, "--no-autotune", "--require-login"); System.setProperty("artemis.instance", instanceFolder.getAbsolutePath()); // Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol Artemis.internalExecute("run"); - Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin"); - Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin"); +// Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin", "--autoCreateAddress"); +// Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin", "--autoCreateAddress"); try { try (ServerLocator locator = ServerLocatorImpl.newLocator("tcp://localhost:61616"); @@ -554,9 +554,9 @@ public class ArtemisTest { ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(str)); assertTrue("Couldn't find queue " + str, queryResult.isExists()); } - for (String str : topics.split(",")) { - ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(str)); - assertTrue("Couldn't find topic " + str, queryResult.isExists()); + for (String str : addresses.split(",")) { + ClientSession.AddressQuery queryResult = coreSession.addressQuery(SimpleString.toSimpleString(str)); + assertTrue("Couldn't find address " + str, queryResult.isExists()); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/edc947d4/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 1c508df..b865361 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 @@ -614,7 +614,6 @@ public class ActiveMQServerImpl implements ActiveMQServer { return postOffice.isAddressBound(SimpleString.toSimpleString(address)); } - // TODO: this should probably look at the addresses too, not just queue bindings @Override public BindingQueryResult bindingQuery(SimpleString address) throws Exception { if (address == null) { @@ -642,7 +641,7 @@ public class ActiveMQServerImpl implements ActiveMQServer { } } - return new BindingQueryResult(!names.isEmpty(), names, autoCreateJmsQueues, autoCreateJmsTopics); + return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateJmsQueues, autoCreateJmsTopics); } @Override