From 29d9443a1eabc31736d001a478e164759ebfac8f Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Tue, 24 Mar 2020 14:19:38 -0500 Subject: [PATCH] ARTEMIS-2680 use q name for addr if none specified via config --- .../integration/server/ConfigurationTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConfigurationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConfigurationTest.java index 48b332776b..cd8219a458 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConfigurationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ConfigurationTest.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.tests.integration.server; import org.apache.activemq.artemis.api.core.SimpleString; +import org.apache.activemq.artemis.core.config.CoreQueueConfiguration; import org.apache.activemq.artemis.core.config.FileDeploymentManager; import org.apache.activemq.artemis.core.config.impl.FileConfiguration; import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration; @@ -27,6 +28,7 @@ import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.tests.util.RandomUtil; import org.junit.Test; public class ConfigurationTest extends ActiveMQTestBase { @@ -47,6 +49,22 @@ public class ConfigurationTest extends ActiveMQTestBase { } } + @Test + public void testQueueWithoutAddressName() throws Exception { + final SimpleString QUEUE_NAME = RandomUtil.randomSimpleString(); + ActiveMQServer server = createServer(false, createDefaultInVMConfig()); + try { + server.getConfiguration().addQueueConfiguration(new CoreQueueConfiguration().setName(QUEUE_NAME.toString())); + server.start(); + assertTrue(server.getAddressInfo(QUEUE_NAME) != null); + } finally { + try { + server.stop(); + } catch (Exception e) { + } + } + } + protected ActiveMQServer getActiveMQServer(String brokerConfig) throws Exception { FileConfiguration fc = new FileConfiguration(); FileJMSConfiguration fileConfiguration = new FileJMSConfiguration();