From 5e1758cb87a387466b5488b0ba177a62c00301ea Mon Sep 17 00:00:00 2001 From: Howard Gao Date: Tue, 30 Jun 2015 10:03:43 +0800 Subject: [PATCH] ARTEMIS-146 Fix Queue auto-creation --- tests/activemq5-unit-tests/pom.xml | 6 ++++++ .../artemiswrapper/ArtemisBrokerWrapper.java | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/activemq5-unit-tests/pom.xml b/tests/activemq5-unit-tests/pom.xml index da44d3eb95..cecd5b3088 100644 --- a/tests/activemq5-unit-tests/pom.xml +++ b/tests/activemq5-unit-tests/pom.xml @@ -304,6 +304,12 @@ ${project.version} + + org.apache.activemq + artemis-jms-server + ${project.version} + + org.apache.activemq artemis-openwire-protocol diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java index b7397301d2..69136fd80f 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java @@ -28,9 +28,11 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration; +import org.apache.activemq.artemis.core.registry.JndiBindingRegistry; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl; import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.broker.BrokerService; @@ -39,6 +41,7 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase { protected final Map testQueues = new HashMap(); + protected JMSServerManagerImpl jmsServer; public ArtemisBrokerWrapper(BrokerService brokerService) { @@ -154,11 +157,12 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase anySet.add(guestRole); anySet.add(destRole); } -/* no need to start jms server here - jmsServer = new JMSServerManagerImpl(server); - jmsServer.setContext(new InVMNamingContext()); - jmsServer.start(); -*/ + + jmsServer = new JMSServerManagerImpl(server); + InVMNamingContext namingContext = new InVMNamingContext(); + jmsServer.setRegistry(new JndiBindingRegistry(namingContext)); + jmsServer.start(); + Set acceptors = serverConfig.getAcceptorConfigurations(); Iterator iter = acceptors.iterator();