activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [02/13] activemq-6 git commit: ACTIVEMQ6-14 Replace JNDI server with client impl
Date Fri, 05 Dec 2014 15:38:26 GMT
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/SimpleJNDIClientTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/SimpleJNDIClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/SimpleJNDIClientTest.java
new file mode 100644
index 0000000..680d429
--- /dev/null
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/SimpleJNDIClientTest.java
@@ -0,0 +1,722 @@
+/**
+ * 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.tests.integration.jms;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Queue;
+import javax.jms.Topic;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.activemq.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.api.core.BroadcastGroupConfiguration;
+import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.api.core.TransportConfiguration;
+import org.apache.activemq.api.core.UDPBroadcastGroupConfiguration;
+import org.apache.activemq.api.jms.JMSFactoryType;
+import org.apache.activemq.core.config.Configuration;
+import org.apache.activemq.core.config.ha.SharedStoreMasterPolicyConfiguration;
+import org.apache.activemq.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.core.server.ActiveMQServer;
+import org.apache.activemq.core.server.ActiveMQServers;
+import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.jndi.ActiveMQInitialContextFactory;
+import org.apache.activemq.tests.util.RandomUtil;
+import org.apache.activemq.tests.util.UnitTestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ * A ActiveMQConnectionFactoryTest
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class SimpleJNDIClientTest extends UnitTestCase
+{
+   private final String groupAddress = getUDPDiscoveryAddress();
+
+   private final int groupPort = getUDPDiscoveryPort();
+
+   private ActiveMQServer liveService;
+
+   private TransportConfiguration liveTC;
+
+   @Test
+   public void testDefaultConnectionFactories() throws NamingException, JMSException
+   {
+      Hashtable<String, Object> props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
+      Assert.assertEquals(JMSFactoryType.CF.intValue(), ((ActiveMQConnectionFactory)connectionFactory).getFactoryType());
+      connectionFactory.createConnection().close();
+
+      connectionFactory = (ConnectionFactory) ctx.lookup("XAConnectionFactory");
+      Assert.assertEquals(JMSFactoryType.XA_CF.intValue(), ((ActiveMQConnectionFactory)connectionFactory).getFactoryType());
+      connectionFactory.createConnection().close();
+
+      connectionFactory = (ConnectionFactory) ctx.lookup("TopicConnectionFactory");
+      Assert.assertEquals(JMSFactoryType.TOPIC_CF.intValue(), ((ActiveMQConnectionFactory)connectionFactory).getFactoryType());
+      connectionFactory.createConnection().close();
+
+      connectionFactory = (ConnectionFactory) ctx.lookup("QueueConnectionFactory");
+      Assert.assertEquals(JMSFactoryType.QUEUE_CF.intValue(), ((ActiveMQConnectionFactory)connectionFactory).getFactoryType());
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testCustomCF() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.type", "CF");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(JMSFactoryType.CF.intValue(), ((ActiveMQConnectionFactory)connectionFactory).getFactoryType());
+
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testVMCF0() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "vm://0");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
+
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testVMCF1() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "vm://1");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
+
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testXACF() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.type", "XA_CF");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(JMSFactoryType.XA_CF.intValue(), connectionFactory.getFactoryType());
+   }
+
+   @Test
+   public void testQueueCF() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.type", "QUEUE_CF");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(JMSFactoryType.QUEUE_CF.intValue(), connectionFactory.getFactoryType());
+   }
+
+   @Test
+   public void testQueueXACF() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.type", "QUEUE_XA_CF");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(JMSFactoryType.QUEUE_XA_CF.intValue(), connectionFactory.getFactoryType());
+   }
+
+   @Test
+   public void testTopicCF() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.type", "TOPIC_CF");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(JMSFactoryType.TOPIC_CF.intValue(), connectionFactory.getFactoryType());
+   }
+
+   @Test
+   public void testTopicXACF() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.type", "TOPIC_XA_CF");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(JMSFactoryType.TOPIC_XA_CF.intValue(), connectionFactory.getFactoryType());
+   }
+
+   @Test
+   public void testCFWithProperties() throws NamingException, JMSException
+   {
+      // we don't test the 'ha' property here because it's not supported on a local connection factory (i.e. one
+      // constructed from an InitialContext where the environment doesn't contain the property "java.naming.provider.url")
+
+      long callFailoverTimeout = RandomUtil.randomPositiveLong();
+      long callTimeout = RandomUtil.randomPositiveLong();
+      long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
+      String clientID = RandomUtil.randomString();
+      int confirmationWindowSize = RandomUtil.randomPositiveInt();
+      String connectionLoadBalancingPolicyClassName = RandomUtil.randomString();
+      long connectionTTL = RandomUtil.randomPositiveLong();
+      int consumerMaxRate = RandomUtil.randomPositiveInt();
+      int consumerWindowSize = RandomUtil.randomPositiveInt();
+      int minLargeMessageSize = RandomUtil.randomPositiveInt();
+      int dupsOKBatchSize = RandomUtil.randomPositiveInt();
+      String groupID = RandomUtil.randomString();
+      int initialConnectAttempts = RandomUtil.randomPositiveInt();
+      int initialMessagePacketSize = RandomUtil.randomPositiveInt();
+      long maxRetryInterval = RandomUtil.randomPositiveLong();
+      int producerMaxRate = RandomUtil.randomPositiveInt();
+      int producerWindowSize = RandomUtil.randomPositiveInt();
+      int reconnectAttempts = RandomUtil.randomPositiveInt();
+      long retryInterval = RandomUtil.randomPositiveLong();
+      double retryIntervalMultiplier = RandomUtil.randomDouble();
+      int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt();
+      int threadPoolMaxSize = RandomUtil.randomPositiveInt();
+      int transactionBatchSize = RandomUtil.randomPositiveInt();
+      boolean autoGroup = RandomUtil.randomBoolean();
+      boolean blockOnAcknowledge = RandomUtil.randomBoolean();
+      boolean blockOnDurableSend = RandomUtil.randomBoolean();
+      boolean blockOnNonDurableSend = RandomUtil.randomBoolean();
+      boolean cacheLargeMessagesClient = RandomUtil.randomBoolean();
+      boolean compressLargeMessage = RandomUtil.randomBoolean();
+      boolean failoverOnInitialConnection = RandomUtil.randomBoolean();
+      boolean preAcknowledge = RandomUtil.randomBoolean();
+      boolean useGlobalPools = RandomUtil.randomBoolean();
+
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.callFailoverTimeout", callFailoverTimeout);
+      props.put("connection.myConnectionFactory.callTimeout", callTimeout);
+      props.put("connection.myConnectionFactory.clientFailureCheckPeriod", clientFailureCheckPeriod);
+      props.put("connection.myConnectionFactory.clientID", clientID);
+      props.put("connection.myConnectionFactory.confirmationWindowSize", confirmationWindowSize);
+      props.put("connection.myConnectionFactory.connectionLoadBalancingPolicyClassName", connectionLoadBalancingPolicyClassName);
+      props.put("connection.myConnectionFactory.connectionTTL", connectionTTL);
+      props.put("connection.myConnectionFactory.consumerMaxRate", consumerMaxRate);
+      props.put("connection.myConnectionFactory.consumerWindowSize", consumerWindowSize);
+      props.put("connection.myConnectionFactory.minLargeMessageSize", minLargeMessageSize);
+      props.put("connection.myConnectionFactory.dupsOKBatchSize", dupsOKBatchSize);
+      props.put("connection.myConnectionFactory.groupID", groupID);
+      props.put("connection.myConnectionFactory.initialConnectAttempts", initialConnectAttempts);
+      props.put("connection.myConnectionFactory.initialMessagePacketSize", initialMessagePacketSize);
+      props.put("connection.myConnectionFactory.maxRetryInterval", maxRetryInterval);
+      props.put("connection.myConnectionFactory.producerMaxRate", producerMaxRate);
+      props.put("connection.myConnectionFactory.producerWindowSize", producerWindowSize);
+      props.put("connection.myConnectionFactory.reconnectAttempts", reconnectAttempts);
+      props.put("connection.myConnectionFactory.retryInterval", retryInterval);
+      props.put("connection.myConnectionFactory.retryIntervalMultiplier", retryIntervalMultiplier);
+      props.put("connection.myConnectionFactory.scheduledThreadPoolMaxSize", scheduledThreadPoolMaxSize);
+      props.put("connection.myConnectionFactory.threadPoolMaxSize", threadPoolMaxSize);
+      props.put("connection.myConnectionFactory.transactionBatchSize", transactionBatchSize);
+      props.put("connection.myConnectionFactory.blockOnAcknowledge", blockOnAcknowledge);
+      props.put("connection.myConnectionFactory.blockOnDurableSend", blockOnDurableSend);
+      props.put("connection.myConnectionFactory.blockOnNonDurableSend", blockOnNonDurableSend);
+      props.put("connection.myConnectionFactory.cacheLargeMessagesClient", cacheLargeMessagesClient);
+      props.put("connection.myConnectionFactory.compressLargeMessage", compressLargeMessage);
+      props.put("connection.myConnectionFactory.failoverOnInitialConnection", failoverOnInitialConnection);
+      props.put("connection.myConnectionFactory.autoGroup", autoGroup);
+      props.put("connection.myConnectionFactory.preAcknowledge", preAcknowledge);
+      props.put("connection.myConnectionFactory.useGlobalPools", useGlobalPools);
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(callFailoverTimeout, cf.getCallFailoverTimeout());
+      Assert.assertEquals(callTimeout, cf.getCallTimeout());
+      Assert.assertEquals(clientFailureCheckPeriod, cf.getClientFailureCheckPeriod());
+      Assert.assertEquals(clientID, cf.getClientID());
+      Assert.assertEquals(confirmationWindowSize, cf.getConfirmationWindowSize());
+      Assert.assertEquals(connectionLoadBalancingPolicyClassName, cf.getConnectionLoadBalancingPolicyClassName());
+      Assert.assertEquals(connectionTTL, cf.getConnectionTTL());
+      Assert.assertEquals(consumerMaxRate, cf.getConsumerMaxRate());
+      Assert.assertEquals(consumerWindowSize, cf.getConsumerWindowSize());
+      Assert.assertEquals(minLargeMessageSize, cf.getMinLargeMessageSize());
+      Assert.assertEquals(dupsOKBatchSize, cf.getDupsOKBatchSize());
+      Assert.assertEquals(groupID, cf.getGroupID());
+      Assert.assertEquals(initialConnectAttempts, cf.getInitialConnectAttempts());
+      Assert.assertEquals(initialMessagePacketSize, cf.getInitialMessagePacketSize());
+      Assert.assertEquals(maxRetryInterval, cf.getMaxRetryInterval());
+      Assert.assertEquals(producerMaxRate, cf.getProducerMaxRate());
+      Assert.assertEquals(producerWindowSize, cf.getProducerWindowSize());
+      Assert.assertEquals(reconnectAttempts, cf.getReconnectAttempts());
+      Assert.assertEquals(retryInterval, cf.getRetryInterval());
+      Assert.assertEquals(retryIntervalMultiplier, cf.getRetryIntervalMultiplier(), 0.0001);
+      Assert.assertEquals(scheduledThreadPoolMaxSize, cf.getScheduledThreadPoolMaxSize());
+      Assert.assertEquals(threadPoolMaxSize, cf.getThreadPoolMaxSize());
+      Assert.assertEquals(transactionBatchSize, cf.getTransactionBatchSize());
+      Assert.assertEquals(autoGroup, cf.isAutoGroup());
+      Assert.assertEquals(blockOnAcknowledge, cf.isBlockOnAcknowledge());
+      Assert.assertEquals(blockOnDurableSend, cf.isBlockOnDurableSend());
+      Assert.assertEquals(blockOnNonDurableSend, cf.isBlockOnNonDurableSend());
+      Assert.assertEquals(cacheLargeMessagesClient, cf.isCacheLargeMessagesClient());
+      Assert.assertEquals(compressLargeMessage, cf.isCompressLargeMessage());
+      Assert.assertEquals(failoverOnInitialConnection, cf.isFailoverOnInitialConnection());
+      Assert.assertEquals(preAcknowledge, cf.isPreAcknowledge());
+      Assert.assertEquals(useGlobalPools, cf.isUseGlobalPools());
+   }
+
+   @Test
+   public void testCFWithStringProperties() throws NamingException, JMSException
+   {
+      // we don't test the 'ha' property here because it's not supported on a local connection factory (i.e. one
+      // constructed from an InitialContext where the environment doesn't contain the property "java.naming.provider.url")
+
+      String callFailoverTimeout = Long.toString(RandomUtil.randomPositiveLong());
+      String callTimeout = Long.toString(RandomUtil.randomPositiveLong());
+      String clientFailureCheckPeriod = Long.toString(RandomUtil.randomPositiveLong());
+      String clientID = RandomUtil.randomString();
+      String confirmationWindowSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String connectionLoadBalancingPolicyClassName = RandomUtil.randomString();
+      String connectionTTL = Long.toString(RandomUtil.randomPositiveLong());
+      String consumerMaxRate = Integer.toString(RandomUtil.randomPositiveInt());
+      String consumerWindowSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String minLargeMessageSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String dupsOKBatchSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String groupID = RandomUtil.randomString();
+      String initialConnectAttempts = Integer.toString(RandomUtil.randomPositiveInt());
+      String initialMessagePacketSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String maxRetryInterval = Long.toString(RandomUtil.randomPositiveLong());
+      String producerMaxRate = Integer.toString(RandomUtil.randomPositiveInt());
+      String producerWindowSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String reconnectAttempts = Integer.toString(RandomUtil.randomPositiveInt());
+      String retryInterval = Long.toString(RandomUtil.randomPositiveLong());
+      String retryIntervalMultiplier = Double.toString(RandomUtil.randomDouble());
+      String scheduledThreadPoolMaxSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String threadPoolMaxSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String transactionBatchSize = Integer.toString(RandomUtil.randomPositiveInt());
+      String autoGroup = Boolean.toString(RandomUtil.randomBoolean());
+      String blockOnAcknowledge = Boolean.toString(RandomUtil.randomBoolean());
+      String blockOnDurableSend = Boolean.toString(RandomUtil.randomBoolean());
+      String blockOnNonDurableSend = Boolean.toString(RandomUtil.randomBoolean());
+      String cacheLargeMessagesClient = Boolean.toString(RandomUtil.randomBoolean());
+      String compressLargeMessage = Boolean.toString(RandomUtil.randomBoolean());
+      String failoverOnInitialConnection = Boolean.toString(RandomUtil.randomBoolean());
+      String preAcknowledge = Boolean.toString(RandomUtil.randomBoolean());
+      String useGlobalPools = Boolean.toString(RandomUtil.randomBoolean());
+
+      Hashtable props = new Hashtable<String, String>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.callFailoverTimeout", callFailoverTimeout);
+      props.put("connection.myConnectionFactory.callTimeout", callTimeout);
+      props.put("connection.myConnectionFactory.clientFailureCheckPeriod", clientFailureCheckPeriod);
+      props.put("connection.myConnectionFactory.clientID", clientID);
+      props.put("connection.myConnectionFactory.confirmationWindowSize", confirmationWindowSize);
+      props.put("connection.myConnectionFactory.connectionLoadBalancingPolicyClassName", connectionLoadBalancingPolicyClassName);
+      props.put("connection.myConnectionFactory.connectionTTL", connectionTTL);
+      props.put("connection.myConnectionFactory.consumerMaxRate", consumerMaxRate);
+      props.put("connection.myConnectionFactory.consumerWindowSize", consumerWindowSize);
+      props.put("connection.myConnectionFactory.minLargeMessageSize", minLargeMessageSize);
+      props.put("connection.myConnectionFactory.dupsOKBatchSize", dupsOKBatchSize);
+      props.put("connection.myConnectionFactory.groupID", groupID);
+      props.put("connection.myConnectionFactory.initialConnectAttempts", initialConnectAttempts);
+      props.put("connection.myConnectionFactory.initialMessagePacketSize", initialMessagePacketSize);
+      props.put("connection.myConnectionFactory.maxRetryInterval", maxRetryInterval);
+      props.put("connection.myConnectionFactory.producerMaxRate", producerMaxRate);
+      props.put("connection.myConnectionFactory.producerWindowSize", producerWindowSize);
+      props.put("connection.myConnectionFactory.reconnectAttempts", reconnectAttempts);
+      props.put("connection.myConnectionFactory.retryInterval", retryInterval);
+      props.put("connection.myConnectionFactory.retryIntervalMultiplier", retryIntervalMultiplier);
+      props.put("connection.myConnectionFactory.scheduledThreadPoolMaxSize", scheduledThreadPoolMaxSize);
+      props.put("connection.myConnectionFactory.threadPoolMaxSize", threadPoolMaxSize);
+      props.put("connection.myConnectionFactory.transactionBatchSize", transactionBatchSize);
+      props.put("connection.myConnectionFactory.blockOnAcknowledge", blockOnAcknowledge);
+      props.put("connection.myConnectionFactory.blockOnDurableSend", blockOnDurableSend);
+      props.put("connection.myConnectionFactory.blockOnNonDurableSend", blockOnNonDurableSend);
+      props.put("connection.myConnectionFactory.cacheLargeMessagesClient", cacheLargeMessagesClient);
+      props.put("connection.myConnectionFactory.compressLargeMessage", compressLargeMessage);
+      props.put("connection.myConnectionFactory.failoverOnInitialConnection", failoverOnInitialConnection);
+      props.put("connection.myConnectionFactory.autoGroup", autoGroup);
+      props.put("connection.myConnectionFactory.preAcknowledge", preAcknowledge);
+      props.put("connection.myConnectionFactory.useGlobalPools", useGlobalPools);
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(Long.parseLong(callFailoverTimeout), cf.getCallFailoverTimeout());
+      Assert.assertEquals(Long.parseLong(callTimeout), cf.getCallTimeout());
+      Assert.assertEquals(Long.parseLong(clientFailureCheckPeriod), cf.getClientFailureCheckPeriod());
+      Assert.assertEquals(clientID, cf.getClientID());
+      Assert.assertEquals(Integer.parseInt(confirmationWindowSize), cf.getConfirmationWindowSize());
+      Assert.assertEquals(connectionLoadBalancingPolicyClassName, cf.getConnectionLoadBalancingPolicyClassName());
+      Assert.assertEquals(Long.parseLong(connectionTTL), cf.getConnectionTTL());
+      Assert.assertEquals(Integer.parseInt(consumerMaxRate), cf.getConsumerMaxRate());
+      Assert.assertEquals(Integer.parseInt(consumerWindowSize), cf.getConsumerWindowSize());
+      Assert.assertEquals(Integer.parseInt(minLargeMessageSize), cf.getMinLargeMessageSize());
+      Assert.assertEquals(Integer.parseInt(dupsOKBatchSize), cf.getDupsOKBatchSize());
+      Assert.assertEquals(groupID, cf.getGroupID());
+      Assert.assertEquals(Integer.parseInt(initialConnectAttempts), cf.getInitialConnectAttempts());
+      Assert.assertEquals(Integer.parseInt(initialMessagePacketSize), cf.getInitialMessagePacketSize());
+      Assert.assertEquals(Long.parseLong(maxRetryInterval), cf.getMaxRetryInterval());
+      Assert.assertEquals(Integer.parseInt(producerMaxRate), cf.getProducerMaxRate());
+      Assert.assertEquals(Integer.parseInt(producerWindowSize), cf.getProducerWindowSize());
+      Assert.assertEquals(Integer.parseInt(reconnectAttempts), cf.getReconnectAttempts());
+      Assert.assertEquals(Long.parseLong(retryInterval), cf.getRetryInterval());
+      Assert.assertEquals(Double.parseDouble(retryIntervalMultiplier), cf.getRetryIntervalMultiplier(), 0.0001);
+      Assert.assertEquals(Integer.parseInt(scheduledThreadPoolMaxSize), cf.getScheduledThreadPoolMaxSize());
+      Assert.assertEquals(Integer.parseInt(threadPoolMaxSize), cf.getThreadPoolMaxSize());
+      Assert.assertEquals(Integer.parseInt(transactionBatchSize), cf.getTransactionBatchSize());
+      Assert.assertEquals(Boolean.parseBoolean(autoGroup), cf.isAutoGroup());
+      Assert.assertEquals(Boolean.parseBoolean(blockOnAcknowledge), cf.isBlockOnAcknowledge());
+      Assert.assertEquals(Boolean.parseBoolean(blockOnDurableSend), cf.isBlockOnDurableSend());
+      Assert.assertEquals(Boolean.parseBoolean(blockOnNonDurableSend), cf.isBlockOnNonDurableSend());
+      Assert.assertEquals(Boolean.parseBoolean(cacheLargeMessagesClient), cf.isCacheLargeMessagesClient());
+      Assert.assertEquals(Boolean.parseBoolean(compressLargeMessage), cf.isCompressLargeMessage());
+      Assert.assertEquals(Boolean.parseBoolean(failoverOnInitialConnection), cf.isFailoverOnInitialConnection());
+      Assert.assertEquals(Boolean.parseBoolean(preAcknowledge), cf.isPreAcknowledge());
+      Assert.assertEquals(Boolean.parseBoolean(useGlobalPools), cf.isUseGlobalPools());
+   }
+
+   @Test
+   public void testRemoteCFWithTCP() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "tcp://127.0.0.1:5445");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testRemoteCFWithTCPandHA() throws NamingException, JMSException
+   {
+      boolean ha = true;
+
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "tcp://127.0.0.1:5445");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      props.put("connection.myConnectionFactory.ha", ha);
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Assert.assertEquals(ha, cf.isHA());
+   }
+
+   @Test
+   public void testRemoteCFWithJGroups() throws Exception
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "jgroups://test-jgroups-file_ping.xml");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) ctx.lookup("ConnectionFactory");
+      connectionFactory.getDiscoveryGroupConfiguration().getBroadcastEndpointFactoryConfiguration().createBroadcastEndpointFactory().createBroadcastEndpoint().close(false);
+   }
+
+   @Test
+   public void testRemoteCFWithJgroupsWithTransportConfig() throws Exception
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getCanonicalName());
+      props.put(Context.PROVIDER_URL, "jgroups://test-jgroups-file_ping.xml?" +
+         ActiveMQInitialContextFactory.REFRESH_TIMEOUT + "=5000&" +
+         ActiveMQInitialContextFactory.DISCOVERY_INITIAL_WAIT_TIMEOUT + "=6000");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("ConnectionFactory");
+
+      DiscoveryGroupConfiguration discoveryGroupConfiguration = cf.getDiscoveryGroupConfiguration();
+      Assert.assertEquals(5000, discoveryGroupConfiguration.getRefreshTimeout());
+      Assert.assertEquals(6000, discoveryGroupConfiguration.getDiscoveryInitialWaitTimeout());
+
+      cf.getDiscoveryGroupConfiguration().getBroadcastEndpointFactoryConfiguration().createBroadcastEndpointFactory().createBroadcastEndpoint().close(false);
+   }
+
+   @Test
+   public void testRemoteCFWithUDP() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "udp://" + getUDPDiscoveryAddress() + ":" + getUDPDiscoveryPort());
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testRemoteCFWithUDPWithTransportConfig() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getCanonicalName());
+      props.put(Context.PROVIDER_URL, "udp://" + getUDPDiscoveryAddress() + ":" + getUDPDiscoveryPort() + "?" +
+         TransportConstants.LOCAL_ADDRESS_PROP_NAME + "=127.0.0.1&" +
+         TransportConstants.LOCAL_PORT_PROP_NAME + "=1198&" +
+         ActiveMQInitialContextFactory.REFRESH_TIMEOUT + "=5000&" +
+         ActiveMQInitialContextFactory.DISCOVERY_INITIAL_WAIT_TIMEOUT + "=6000");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      DiscoveryGroupConfiguration discoveryGroupConfiguration = cf.getDiscoveryGroupConfiguration();
+      Assert.assertEquals(5000, discoveryGroupConfiguration.getRefreshTimeout());
+      Assert.assertEquals(6000, discoveryGroupConfiguration.getDiscoveryInitialWaitTimeout());
+
+      UDPBroadcastGroupConfiguration udpBroadcastGroupConfiguration = (UDPBroadcastGroupConfiguration) discoveryGroupConfiguration.getBroadcastEndpointFactoryConfiguration();
+      Assert.assertEquals("127.0.0.1", udpBroadcastGroupConfiguration.getLocalBindAddress());
+      Assert.assertEquals(1198, udpBroadcastGroupConfiguration.getLocalBindPort());
+      Assert.assertEquals(getUDPDiscoveryAddress(), udpBroadcastGroupConfiguration.getGroupAddress());
+      Assert.assertEquals(getUDPDiscoveryPort(), udpBroadcastGroupConfiguration.getGroupPort());
+   }
+
+   @Test
+   public void testRemoteCFWithMultipleHosts() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "tcp://127.0.0.1:5445,127.0.0.2:5446");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      Context ctx = new InitialContext(props);
+
+      ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      connectionFactory.createConnection().close();
+   }
+
+   @Test
+   public void testRemoteCFWithTransportConfig() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put(Context.PROVIDER_URL, "tcp://127.0.0.1:5445?" +
+         TransportConstants.SSL_ENABLED_PROP_NAME + "=mySSLEnabledPropValue&" +
+         TransportConstants.HTTP_ENABLED_PROP_NAME + "=myHTTPEnabledPropValue&" +
+         TransportConstants.HTTP_CLIENT_IDLE_PROP_NAME + "=myHTTPClientIdlePropValue&" +
+         TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD + "=myHTTPClientIdleScanPeriodValue&" +
+         TransportConstants.HTTP_REQUIRES_SESSION_ID + "=myHTTPRequiresSessionIDValue&" +
+         TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME + "=myHTTPUpgradeEnabledPropValue&" +
+         TransportConstants.HTTP_UPGRADE_ENDPOINT_PROP_NAME + "=myHTTPUpgradeEndpointPropValue&" +
+         TransportConstants.USE_SERVLET_PROP_NAME + "=myUseServletPropValue&" +
+         TransportConstants.SERVLET_PATH + "=myServletPathValue&" +
+         TransportConstants.USE_NIO_PROP_NAME + "=myUseNIOPropValue&" +
+         TransportConstants.USE_NIO_GLOBAL_WORKER_POOL_PROP_NAME + "=myUseNIOGlobalWorkerPoolPropValue&" +
+         TransportConstants.LOCAL_ADDRESS_PROP_NAME + "=myLocalAddressPropValue&" +
+         TransportConstants.LOCAL_PORT_PROP_NAME + "=myLocalPortPropValue&" +
+         TransportConstants.KEYSTORE_PROVIDER_PROP_NAME + "=myKeystoreProviderPropValue&" +
+         TransportConstants.KEYSTORE_PATH_PROP_NAME + "=myKeystorePathPropValue&" +
+         TransportConstants.KEYSTORE_PASSWORD_PROP_NAME + "=myKeystorePasswordPropValue&" +
+         TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME + "=myTruststoreProviderPropValue&" +
+         TransportConstants.TRUSTSTORE_PATH_PROP_NAME + "=myTruststorePathPropValue&" +
+         TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME + "=myTruststorePasswordPropValue&" +
+         TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME + "=myEnabledCipherSuitesPropValue&" +
+         TransportConstants.ENABLED_PROTOCOLS_PROP_NAME + "=myEnabledProtocolsPropValue&" +
+         TransportConstants.TCP_NODELAY_PROPNAME + "=myTCPNoDelayPropValue&" +
+         TransportConstants.TCP_SENDBUFFER_SIZE_PROPNAME + "=myTCPSendbufferSizePropValue&" +
+         TransportConstants.TCP_RECEIVEBUFFER_SIZE_PROPNAME + "=myTCPReceivebufferSizePropValue&" +
+         TransportConstants.NIO_REMOTING_THREADS_PROPNAME + "=myNIORemotingThreadsPropValue&" +
+         TransportConstants.BATCH_DELAY + "=myBatchDelay&" +
+         ActiveMQDefaultConfiguration.getPropMaskPassword() + "=myPropMaskPassword&" +
+         ActiveMQDefaultConfiguration.getPropPasswordCodec() + "=myPropPasswordCodec&" +
+         TransportConstants.NETTY_CONNECT_TIMEOUT + "=myNettyConnectTimeout&");
+      props.put(ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES, "myConnectionFactory");
+      Context ctx = new InitialContext(props);
+
+      ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
+
+      Map parametersFromJNDI = cf.getServerLocator().getStaticTransportConfigurations()[0].getParams();
+
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.SSL_ENABLED_PROP_NAME), "mySSLEnabledPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.HTTP_ENABLED_PROP_NAME), "myHTTPEnabledPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.HTTP_CLIENT_IDLE_PROP_NAME), "myHTTPClientIdlePropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD), "myHTTPClientIdleScanPeriodValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.HTTP_REQUIRES_SESSION_ID), "myHTTPRequiresSessionIDValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.HTTP_UPGRADE_ENABLED_PROP_NAME), "myHTTPUpgradeEnabledPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.HTTP_UPGRADE_ENDPOINT_PROP_NAME), "myHTTPUpgradeEndpointPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.USE_SERVLET_PROP_NAME), "myUseServletPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.SERVLET_PATH), "myServletPathValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.USE_NIO_PROP_NAME), "myUseNIOPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.USE_NIO_GLOBAL_WORKER_POOL_PROP_NAME), "myUseNIOGlobalWorkerPoolPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.LOCAL_ADDRESS_PROP_NAME), "myLocalAddressPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.LOCAL_PORT_PROP_NAME), "myLocalPortPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.KEYSTORE_PROVIDER_PROP_NAME), "myKeystoreProviderPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.KEYSTORE_PATH_PROP_NAME), "myKeystorePathPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME), "myKeystorePasswordPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.TRUSTSTORE_PROVIDER_PROP_NAME), "myTruststoreProviderPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.TRUSTSTORE_PATH_PROP_NAME), "myTruststorePathPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME), "myTruststorePasswordPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME), "myEnabledCipherSuitesPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.ENABLED_PROTOCOLS_PROP_NAME), "myEnabledProtocolsPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.TCP_NODELAY_PROPNAME), "myTCPNoDelayPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.TCP_SENDBUFFER_SIZE_PROPNAME), "myTCPSendbufferSizePropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.TCP_RECEIVEBUFFER_SIZE_PROPNAME), "myTCPReceivebufferSizePropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.NIO_REMOTING_THREADS_PROPNAME), "myNIORemotingThreadsPropValue");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.BATCH_DELAY), "myBatchDelay");
+      Assert.assertEquals(parametersFromJNDI.get(ActiveMQDefaultConfiguration.getPropMaskPassword()), "myPropMaskPassword");
+      Assert.assertEquals(parametersFromJNDI.get(ActiveMQDefaultConfiguration.getPropPasswordCodec()), "myPropPasswordCodec");
+      Assert.assertEquals(parametersFromJNDI.get(TransportConstants.NETTY_CONNECT_TIMEOUT), "myNettyConnectTimeout");
+   }
+
+   @Override
+   @Before
+   public void setUp() throws Exception
+   {
+      super.setUp();
+
+      startServer();
+   }
+
+   private void startServer() throws Exception
+   {
+      liveTC = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
+      Map<String, TransportConfiguration> connectors = new HashMap<String, TransportConfiguration>();
+      connectors.put(liveTC.getName(), liveTC);
+      List<String> connectorNames = new ArrayList<String>();
+      connectorNames.add(liveTC.getName());
+
+      Map params = new HashMap();
+      params.put("server-id", 1);
+
+      Configuration liveConf = createBasicConfig()
+         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY))
+         .addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, params))
+         .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY))
+         .setConnectorConfigurations(connectors)
+         .setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration());
+
+      final long broadcastPeriod = 250;
+
+      final String bcGroupName = "bc1";
+
+      final int localBindPort = 5432;
+
+      BroadcastGroupConfiguration bcConfig1 = new BroadcastGroupConfiguration()
+         .setName(bcGroupName)
+         .setBroadcastPeriod(broadcastPeriod)
+         .setConnectorInfos(connectorNames)
+         .setEndpointFactoryConfiguration(new UDPBroadcastGroupConfiguration()
+                                             .setGroupAddress(groupAddress)
+                                             .setGroupPort(groupPort)
+                                             .setLocalBindPort(localBindPort));
+
+      List<BroadcastGroupConfiguration> bcConfigs1 = new ArrayList<BroadcastGroupConfiguration>();
+      bcConfigs1.add(bcConfig1);
+      liveConf.setBroadcastGroupConfigurations(bcConfigs1);
+
+      liveService = addServer(ActiveMQServers.newActiveMQServer(liveConf, false));
+      liveService.start();
+   }
+
+   @Test
+   public void testQueue() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put("queue.myQueue", "myQueue");
+      props.put("queue.queues/myQueue", "myQueue");
+      Context ctx = new InitialContext(props);
+
+      Destination destination = (Destination) ctx.lookup("myQueue");
+      Assert.assertTrue(destination instanceof Queue);
+
+      destination = (Destination) ctx.lookup("queues/myQueue");
+      Assert.assertTrue(destination instanceof Queue);
+   }
+
+   @Test
+   public void testDynamicQueue() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      Context ctx = new InitialContext(props);
+
+      Destination destination = (Destination) ctx.lookup("dynamicQueues/myQueue");
+      Assert.assertTrue(destination instanceof Queue);
+   }
+
+   @Test
+   public void testTopic() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      props.put("topic.myTopic", "myTopic");
+      props.put("topic.topics/myTopic", "myTopic");
+      Context ctx = new InitialContext(props);
+
+      Destination destination = (Destination) ctx.lookup("myTopic");
+      Assert.assertTrue(destination instanceof Topic);
+
+      destination = (Destination) ctx.lookup("topics/myTopic");
+      Assert.assertTrue(destination instanceof Topic);
+   }
+
+   @Test
+   public void testDynamicTopic() throws NamingException, JMSException
+   {
+      Hashtable props = new Hashtable<>();
+      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
+      Context ctx = new InitialContext(props);
+
+      Destination destination = (Destination) ctx.lookup("dynamicTopics/myTopic");
+      Assert.assertTrue(destination instanceof Topic);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
index 4ce9f14..bede98b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/JMSServerDeployerTest.java
@@ -19,7 +19,6 @@ package org.apache.activemq.tests.integration.jms.server;
 import javax.jms.Queue;
 import javax.jms.Topic;
 import javax.naming.Context;
-import java.net.URI;
 
 import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.api.core.TransportConfiguration;
@@ -29,14 +28,12 @@ import org.apache.activemq.core.deployers.DeploymentManager;
 import org.apache.activemq.core.deployers.impl.FileDeploymentManager;
 import org.apache.activemq.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.core.server.ActiveMQServer;
-import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.jms.server.JMSServerManager;
 import org.apache.activemq.jms.server.impl.JMSServerDeployer;
 import org.apache.activemq.jms.server.impl.JMSServerManagerImpl;
 import org.apache.activemq.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.tests.unit.util.InVMNamingContext;
 import org.apache.activemq.tests.util.ServiceTestBase;
-import org.apache.activemq.tests.util.UnitTestCase;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -93,7 +90,6 @@ public class JMSServerDeployerTest extends ServiceTestBase
       doTestDeployQueuesWithUnusualNames("queue\\with\\backslashes\\in\\name", "/myqueue4");
 
       doTestDeployQueuesWithUnusualNames("queue with # chars and * chars in name",
-                                         "queue with &#35; chars and &#42; chars in name",
                                          "/myqueue5");
    }
 
@@ -109,21 +105,13 @@ public class JMSServerDeployerTest extends ServiceTestBase
       doTestDeployTopicsWithUnusualNames("topic\\with\\backslashes\\in\\name", "/mytopic4");
 
       doTestDeployTopicsWithUnusualNames("topic with # chars and * chars in name",
-                                         "topic with &#35; chars and &#42; chars in name",
                                          "/mytopic5");
    }
 
    private void doTestDeployQueuesWithUnusualNames(final String queueName,
-                                                   final String htmlEncodedName,
                                                    final String jndiName) throws Exception
    {
-      JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager);
-
-      String xml = "<queue name=\"" + htmlEncodedName + "\">" + "<entry name=\"" + jndiName + "\"/>" + "</queue>";
-
-      Element rootNode = org.apache.activemq.utils.XMLUtil.stringToElement(xml);
-
-      deployer.deploy(rootNode);
+      jmsServer.createQueue(false, queueName, null, false, jndiName);
 
       Queue queue = (Queue) context.lookup(jndiName);
       Assert.assertNotNull(queue);
@@ -131,206 +119,15 @@ public class JMSServerDeployerTest extends ServiceTestBase
    }
 
    private void doTestDeployTopicsWithUnusualNames(final String topicName,
-                                                   final String htmlEncodedName,
                                                    final String jndiName) throws Exception
    {
-      JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager);
-
-      String xml =
-
-         "<topic name=\"" + htmlEncodedName + "\">" + "<entry name=\"" + jndiName + "\"/>" + "</topic>";
-
-      Element rootNode = org.apache.activemq.utils.XMLUtil.stringToElement(xml);
-
-      deployer.deploy(rootNode);
+      jmsServer.createTopic(false, topicName, jndiName);
 
       Topic topic = (Topic) context.lookup(jndiName);
       Assert.assertNotNull(topic);
       Assert.assertEquals(topicName, topic.getTopicName());
    }
 
-   private void doTestDeployQueuesWithUnusualNames(final String queueName, final String jndiName) throws Exception
-   {
-      doTestDeployQueuesWithUnusualNames(queueName, queueName, jndiName);
-   }
-
-   private void doTestDeployTopicsWithUnusualNames(final String topicName, final String jndiName) throws Exception
-   {
-      doTestDeployTopicsWithUnusualNames(topicName, topicName, jndiName);
-   }
-
-   @Test
-   public void testDeployFullConfiguration() throws Exception
-   {
-      JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager);
-
-      String conf = "activemq-jms-for-JMSServerDeployerTest.xml";
-      URI confURL = Thread.currentThread().getContextClassLoader().getResource(conf).toURI();
-
-      String[] connectionFactoryBindings = new String[]{"/fullConfigurationConnectionFactory",
-         "/acme/fullConfigurationConnectionFactory",
-         "java:/xyz/tfullConfigurationConnectionFactory",
-         "java:/connectionfactories/acme/fullConfigurationConnectionFactory"};
-      String[] queueBindings = new String[]{"/fullConfigurationQueue", "/queue/fullConfigurationQueue"};
-      String[] topicBindings = new String[]{"/fullConfigurationTopic", "/topic/fullConfigurationTopic"};
-
-      for (String binding : connectionFactoryBindings)
-      {
-         UnitTestCase.checkNoBinding(context, binding);
-      }
-      for (String binding : queueBindings)
-      {
-         UnitTestCase.checkNoBinding(context, binding);
-      }
-      for (String binding : topicBindings)
-      {
-         UnitTestCase.checkNoBinding(context, binding);
-      }
-
-      deployer.deploy(confURL);
-
-      for (String binding : connectionFactoryBindings)
-      {
-         UnitTestCase.checkBinding(context, binding);
-      }
-      for (String binding : queueBindings)
-      {
-         UnitTestCase.checkBinding(context, binding);
-      }
-      for (String binding : topicBindings)
-      {
-         UnitTestCase.checkBinding(context, binding);
-      }
-
-      for (String binding : connectionFactoryBindings)
-      {
-         ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) context.lookup(binding);
-         Assert.assertNotNull(cf);
-         Assert.assertEquals(1234, cf.getClientFailureCheckPeriod());
-         Assert.assertEquals(5678, cf.getCallTimeout());
-         Assert.assertEquals(12345, cf.getConsumerWindowSize());
-         Assert.assertEquals(6789, cf.getConsumerMaxRate());
-         Assert.assertEquals(123456, cf.getConfirmationWindowSize());
-         Assert.assertEquals(7712652, cf.getProducerWindowSize());
-         Assert.assertEquals(789, cf.getProducerMaxRate());
-         Assert.assertEquals(12, cf.getMinLargeMessageSize());
-         Assert.assertEquals("TestClientID", cf.getClientID());
-         Assert.assertEquals(3456, cf.getDupsOKBatchSize());
-         Assert.assertEquals(4567, cf.getTransactionBatchSize());
-         Assert.assertEquals(true, cf.isBlockOnAcknowledge());
-         Assert.assertEquals(false, cf.isBlockOnNonDurableSend());
-         Assert.assertEquals(true, cf.isBlockOnDurableSend());
-         Assert.assertEquals(false, cf.isAutoGroup());
-         Assert.assertEquals(true, cf.isPreAcknowledge());
-         Assert.assertEquals(2345, cf.getConnectionTTL());
-         assertEquals(true, cf.isFailoverOnInitialConnection());
-         Assert.assertEquals(34, cf.getReconnectAttempts());
-         Assert.assertEquals(5, cf.getRetryInterval());
-         Assert.assertEquals(6.0, cf.getRetryIntervalMultiplier(), 0.000001);
-         Assert.assertEquals(true, cf.isCacheLargeMessagesClient());
-      }
-
-      for (String binding : queueBindings)
-      {
-         Queue queue = (Queue) context.lookup(binding);
-         Assert.assertNotNull(queue);
-         Assert.assertEquals("fullConfigurationQueue", queue.getQueueName());
-      }
-
-      for (String binding : topicBindings)
-      {
-         Topic topic = (Topic) context.lookup(binding);
-         Assert.assertNotNull(topic);
-         Assert.assertEquals("fullConfigurationTopic", topic.getTopicName());
-      }
-   }
-
-   @Test
-   public void testDeployFullConfiguration2() throws Exception
-   {
-      JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager);
-
-      String conf = "activemq-jms-for-JMSServerDeployerTest2.xml";
-      URI confURL = Thread.currentThread().getContextClassLoader().getResource(conf).toURI();
-
-      String[] connectionFactoryBindings = new String[]{"/fullConfigurationConnectionFactory",
-         "/acme/fullConfigurationConnectionFactory",
-         "java:/xyz/tfullConfigurationConnectionFactory",
-         "java:/connectionfactories/acme/fullConfigurationConnectionFactory"};
-      String[] queueBindings = new String[]{"/fullConfigurationQueue", "/queue/fullConfigurationQueue"};
-      String[] topicBindings = new String[]{"/fullConfigurationTopic", "/topic/fullConfigurationTopic"};
-
-      for (String binding : connectionFactoryBindings)
-      {
-         UnitTestCase.checkNoBinding(context, binding);
-      }
-      for (String binding : queueBindings)
-      {
-         UnitTestCase.checkNoBinding(context, binding);
-      }
-      for (String binding : topicBindings)
-      {
-         UnitTestCase.checkNoBinding(context, binding);
-      }
-
-      deployer.deploy(confURL);
-
-      for (String binding : connectionFactoryBindings)
-      {
-         UnitTestCase.checkBinding(context, binding);
-      }
-      for (String binding : queueBindings)
-      {
-         UnitTestCase.checkBinding(context, binding);
-      }
-      for (String binding : topicBindings)
-      {
-         UnitTestCase.checkBinding(context, binding);
-      }
-
-      for (String binding : connectionFactoryBindings)
-      {
-         ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) context.lookup(binding);
-         Assert.assertNotNull(cf);
-         Assert.assertEquals(1234, cf.getClientFailureCheckPeriod());
-         Assert.assertEquals(5678, cf.getCallTimeout());
-         Assert.assertEquals(12345, cf.getConsumerWindowSize());
-         Assert.assertEquals(6789, cf.getConsumerMaxRate());
-         Assert.assertEquals(123456, cf.getConfirmationWindowSize());
-         Assert.assertEquals(7712652, cf.getProducerWindowSize());
-         Assert.assertEquals(789, cf.getProducerMaxRate());
-         Assert.assertEquals(12, cf.getMinLargeMessageSize());
-         Assert.assertEquals("TestClientID", cf.getClientID());
-         Assert.assertEquals(3456, cf.getDupsOKBatchSize());
-         Assert.assertEquals(4567, cf.getTransactionBatchSize());
-         Assert.assertEquals(true, cf.isBlockOnAcknowledge());
-         Assert.assertEquals(false, cf.isBlockOnNonDurableSend());
-         Assert.assertEquals(true, cf.isBlockOnDurableSend());
-         Assert.assertEquals(false, cf.isAutoGroup());
-         Assert.assertEquals(true, cf.isPreAcknowledge());
-         Assert.assertEquals(2345, cf.getConnectionTTL());
-         assertEquals(true, cf.isFailoverOnInitialConnection());
-         Assert.assertEquals(34, cf.getReconnectAttempts());
-         Assert.assertEquals(5, cf.getRetryInterval());
-         Assert.assertEquals(6.0, cf.getRetryIntervalMultiplier(), 0.000001);
-         Assert.assertEquals(true, cf.isCacheLargeMessagesClient());
-      }
-
-      for (String binding : queueBindings)
-      {
-         Queue queue = (Queue) context.lookup(binding);
-         Assert.assertNotNull(queue);
-         Assert.assertEquals("fullConfigurationQueue", queue.getQueueName());
-      }
-
-      for (String binding : topicBindings)
-      {
-         Topic topic = (Topic) context.lookup(binding);
-         Assert.assertNotNull(topic);
-         Assert.assertEquals("fullConfigurationTopic", topic.getTopicName());
-      }
-   }
-
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSServerConfigParserTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSServerConfigParserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSServerConfigParserTest.java
index 0255aab..0957a31 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSServerConfigParserTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/config/JMSServerConfigParserTest.java
@@ -24,7 +24,6 @@ import java.net.URL;
 import org.apache.activemq.api.core.TransportConfiguration;
 import org.apache.activemq.core.config.Configuration;
 import org.apache.activemq.jms.server.JMSServerConfigParser;
-import org.apache.activemq.jms.server.config.ConnectionFactoryConfiguration;
 import org.apache.activemq.jms.server.config.JMSConfiguration;
 import org.apache.activemq.jms.server.config.JMSQueueConfiguration;
 import org.apache.activemq.jms.server.config.TopicConfiguration;
@@ -69,49 +68,15 @@ public class JMSServerConfigParserTest extends ServiceTestBase
       JMSConfiguration jmsconfig = parser.parseConfiguration(stream);
       stream.close();
 
-      ConnectionFactoryConfiguration cfConfig = jmsconfig.getConnectionFactoryConfigurations().get(0);
-
-      assertEquals(1234, cfConfig.getClientFailureCheckPeriod());
-      assertEquals(5678, cfConfig.getCallTimeout());
-      assertEquals(12345, cfConfig.getConsumerWindowSize());
-      assertEquals(6789, cfConfig.getConsumerMaxRate());
-      assertEquals(123456, cfConfig.getConfirmationWindowSize());
-      assertEquals(7712652, cfConfig.getProducerWindowSize());
-      assertEquals(789, cfConfig.getProducerMaxRate());
-      assertEquals(12, cfConfig.getMinLargeMessageSize());
-      assertEquals(true, cfConfig.isCompressLargeMessages());
-      assertEquals("TestClientID", cfConfig.getClientID());
-      assertEquals(3456, cfConfig.getDupsOKBatchSize());
-      assertEquals(4567, cfConfig.getTransactionBatchSize());
-      assertEquals(true, cfConfig.isBlockOnAcknowledge());
-      assertEquals(false, cfConfig.isBlockOnNonDurableSend());
-      assertEquals(true, cfConfig.isBlockOnDurableSend());
-      assertEquals(false, cfConfig.isAutoGroup());
-      assertEquals(true, cfConfig.isPreAcknowledge());
-      assertEquals(2345, cfConfig.getConnectionTTL());
-      assertEquals("FooClass", cfConfig.getLoadBalancingPolicyClassName());
-      assertEquals(34, cfConfig.getReconnectAttempts());
-      assertEquals(5, cfConfig.getRetryInterval());
-      assertEquals(6.0, cfConfig.getRetryIntervalMultiplier(), 0.000001);
-      assertEquals(300, cfConfig.getMaxRetryInterval());
-      assertEquals(true, cfConfig.isCacheLargeMessagesClient());
-
-
       assertEquals(1, jmsconfig.getQueueConfigurations().size());
 
       JMSQueueConfiguration queueConfig = jmsconfig.getQueueConfigurations().get(0);
       assertEquals("fullConfigurationQueue", queueConfig.getName());
-      assertEquals(2, queueConfig.getBindings().length);
-      assertEquals("/fullConfigurationQueue", queueConfig.getBindings()[0]);
-      assertEquals("/queue/fullConfigurationQueue", queueConfig.getBindings()[1]);
 
 
       assertEquals(1, jmsconfig.getTopicConfigurations().size());
       TopicConfiguration topicConfig = jmsconfig.getTopicConfigurations().get(0);
       assertEquals("fullConfigurationTopic", topicConfig.getName());
-      assertEquals(2, topicConfig.getBindings().length);
-      assertEquals("/fullConfigurationTopic", topicConfig.getBindings()[0]);
-      assertEquals("/topic/fullConfigurationTopic", topicConfig.getBindings()[1]);
 
 
    }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
index 355b68c..7778a45 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/ra/ActiveMQRATestBase.java
@@ -119,6 +119,7 @@ public abstract class ActiveMQRATestBase extends JMSTestBase
          isDeliveryTransacted = deliveryTransacted;
       }
 
+      @Override
       public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
       {
          if (xaResource != null)
@@ -196,11 +197,13 @@ public abstract class ActiveMQRATestBase extends JMSTestBase
          return null;
       }
 
+      @Override
       public WorkManager getWorkManager()
       {
          return workManager;
       }
 
+      @Override
       public XATerminator getXATerminator()
       {
          return null;
@@ -208,29 +211,35 @@ public abstract class ActiveMQRATestBase extends JMSTestBase
 
       class DummyWorkManager implements WorkManager
       {
+         @Override
          public void doWork(Work work) throws WorkException
          {
          }
 
+         @Override
          public void doWork(Work work, long l, ExecutionContext executionContext, WorkListener workListener) throws WorkException
          {
          }
 
+         @Override
          public long startWork(Work work) throws WorkException
          {
             return 0;
          }
 
+         @Override
          public long startWork(Work work, long l, ExecutionContext executionContext, WorkListener workListener) throws WorkException
          {
             return 0;
          }
 
+         @Override
          public void scheduleWork(Work work) throws WorkException
          {
             work.run();
          }
 
+         @Override
          public void scheduleWork(Work work, long l, ExecutionContext executionContext, WorkListener workListener) throws WorkException
          {
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/spring/SpringIntegrationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/spring/SpringIntegrationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/spring/SpringIntegrationTest.java
index ff9d7dc..b9cd6f2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/spring/SpringIntegrationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/spring/SpringIntegrationTest.java
@@ -50,9 +50,10 @@ public class SpringIntegrationTest extends UnitTestCase
    public void testSpring() throws Exception
    {
       System.out.println("Creating bean factory...");
-      ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring-jms-beans.xml"});
+      ApplicationContext context = null;
       try
       {
+         context = new ClassPathXmlApplicationContext(new String[]{"spring-jms-beans.xml"});
          MessageSender sender = (MessageSender) context.getBean("MessageSender");
          System.out.println("Sending message...");
          ExampleListener.latch.countUp();
@@ -66,8 +67,11 @@ public class SpringIntegrationTest extends UnitTestCase
       {
          try
          {
-            DefaultMessageListenerContainer container = (DefaultMessageListenerContainer) context.getBean("listenerContainer");
-            container.stop();
+            if (context != null)
+            {
+               DefaultMessageListenerContainer container = (DefaultMessageListenerContainer) context.getBean("listenerContainer");
+               container.stop();
+            }
          }
          catch (Throwable ignored)
          {
@@ -75,8 +79,11 @@ public class SpringIntegrationTest extends UnitTestCase
          }
          try
          {
-            EmbeddedJMS jms = (EmbeddedJMS) context.getBean("EmbeddedJms");
-            jms.stop();
+            if (context != null)
+            {
+               EmbeddedJMS jms = (EmbeddedJMS) context.getBean("EmbeddedJms");
+               jms.stop();
+            }
          }
          catch (Throwable ignored)
          {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/java/org/apache/activemq/tests/util/NonSerializableFactory.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/util/NonSerializableFactory.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/util/NonSerializableFactory.java
index f1a62d5..6d1bba7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/util/NonSerializableFactory.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/util/NonSerializableFactory.java
@@ -21,14 +21,12 @@ import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.RefAddr;
 import javax.naming.Reference;
-import javax.naming.StringRefAddr;
 import javax.naming.spi.ObjectFactory;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
 
-import org.jboss.util.naming.Util;
 
 /**
  * used by the default context when running in embedded local configuration
@@ -43,47 +41,47 @@ public final class NonSerializableFactory implements ObjectFactory
       // Utility
    }
 
-   public static void unbind(final Context ctx, final String strName) throws NamingException
-   {
-      Name name = ctx.getNameParser("").parse(strName);
-      int size = name.size();
-      String atom = name.get(size - 1);
-      Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
-      String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
-      NonSerializableFactory.getWrapperMap().remove(key);
-      Util.unbind(ctx, strName);
-   }
-
-   public static void rebind(final Context ctx, final String strName, final Object value) throws NamingException
-   {
-      Name name = ctx.getNameParser("").parse(strName);
-      int size = name.size();
-      String atom = name.get(size - 1);
-      Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
-      String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
-      NonSerializableFactory.getWrapperMap().put(key, value);
-      String className = value.getClass().getName();
-      String factory = NonSerializableFactory.class.getName();
-      StringRefAddr addr = new StringRefAddr("nns", key);
-      Reference memoryRef = new Reference(className, addr, factory, null);
-      parentCtx.rebind(atom, memoryRef);
-   }
-
-   public static void bind(final Context ctx, final String strName, final Object value) throws NamingException
-   {
-      Name name = ctx.getNameParser("").parse(strName);
-      int size = name.size();
-      String atom = name.get(size - 1);
-      Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
-      String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
-      NonSerializableFactory.getWrapperMap().put(key, value);
-      String className = value.getClass().getName();
-      String factory = NonSerializableFactory.class.getName();
-      StringRefAddr addr = new StringRefAddr("nns", key);
-      Reference memoryRef = new Reference(className, addr, factory, null);
-
-      parentCtx.bind(atom, memoryRef);
-   }
+//   public static void unbind(final Context ctx, final String strName) throws NamingException
+//   {
+//      Name name = ctx.getNameParser("").parse(strName);
+//      int size = name.size();
+//      String atom = name.get(size - 1);
+//      Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+//      String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+//      NonSerializableFactory.getWrapperMap().remove(key);
+//      Util.unbind(ctx, strName);
+//   }
+//
+//   public static void rebind(final Context ctx, final String strName, final Object value) throws NamingException
+//   {
+//      Name name = ctx.getNameParser("").parse(strName);
+//      int size = name.size();
+//      String atom = name.get(size - 1);
+//      Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+//      String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+//      NonSerializableFactory.getWrapperMap().put(key, value);
+//      String className = value.getClass().getName();
+//      String factory = NonSerializableFactory.class.getName();
+//      StringRefAddr addr = new StringRefAddr("nns", key);
+//      Reference memoryRef = new Reference(className, addr, factory, null);
+//      parentCtx.rebind(atom, memoryRef);
+//   }
+//
+//   public static void bind(final Context ctx, final String strName, final Object value) throws NamingException
+//   {
+//      Name name = ctx.getNameParser("").parse(strName);
+//      int size = name.size();
+//      String atom = name.get(size - 1);
+//      Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+//      String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+//      NonSerializableFactory.getWrapperMap().put(key, value);
+//      String className = value.getClass().getName();
+//      String factory = NonSerializableFactory.class.getName();
+//      StringRefAddr addr = new StringRefAddr("nns", key);
+//      Reference memoryRef = new Reference(className, addr, factory, null);
+//
+//      parentCtx.bind(atom, memoryRef);
+//   }
 
    public static Object lookup(final String name) throws NamingException
    {

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest.xml b/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest.xml
index 021796c..8fb11a9 100644
--- a/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest.xml
+++ b/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest.xml
@@ -2,52 +2,8 @@
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:activemq ../../src/schemas/activemq-jms.xsd ">
 
-   <connection-factory name="fullConfigurationConnectionFactory">
-      <entries>
-         <entry name="/fullConfigurationConnectionFactory"/>
-         <entry name="/acme/fullConfigurationConnectionFactory"/>
-         <entry name="java:/xyz/tfullConfigurationConnectionFactory"/>
-         <entry name="java:/connectionfactories/acme/fullConfigurationConnectionFactory"/>
-      </entries>
-      <connectors>
-         <connector-ref connector-name="netty"/>
-      </connectors>
-      <client-failure-check-period>1234</client-failure-check-period>
-      <call-timeout>5678</call-timeout>
-      <consumer-window-size>12345</consumer-window-size>
-      <consumer-max-rate>6789</consumer-max-rate>
-      <confirmation-window-size>123456</confirmation-window-size>
-      <producer-window-size>7712652</producer-window-size>
-      <producer-max-rate>789</producer-max-rate>
-      <min-large-message-size>12</min-large-message-size>
-      <compress-large-messages>true</compress-large-messages>
-      <client-id>TestClientID</client-id>
-      <dups-ok-batch-size>3456</dups-ok-batch-size>
-      <transaction-batch-size>4567</transaction-batch-size>
-      <block-on-acknowledge>true</block-on-acknowledge>
-      <block-on-non-durable-send>false</block-on-non-durable-send>
-      <block-on-durable-send>true</block-on-durable-send>
-      <auto-group>false</auto-group>
-      <pre-acknowledge>true</pre-acknowledge>
-      <connection-ttl>2345</connection-ttl>
-      <failover-on-initial-connection>true</failover-on-initial-connection>
-      <failover-on-server-shutdown>false</failover-on-server-shutdown>
-      <connection-load-balancing-policy-class-name>FooClass</connection-load-balancing-policy-class-name>
-      <reconnect-attempts>34</reconnect-attempts>
-      <retry-interval>5</retry-interval>
-      <retry-interval-multiplier>6.0</retry-interval-multiplier>
-      <max-retry-interval>300</max-retry-interval>
-      <cache-large-message-client>true</cache-large-message-client>
-   </connection-factory>
+   <queue name="fullConfigurationQueue"/>
 
-   <queue name="fullConfigurationQueue">
-      <entry name="/fullConfigurationQueue"/>
-      <entry name="/queue/fullConfigurationQueue"/>
-   </queue>
-
-   <topic name="fullConfigurationTopic">
-      <entry name="/fullConfigurationTopic"/>
-      <entry name="/topic/fullConfigurationTopic"/>
-   </topic>
+   <topic name="fullConfigurationTopic"/>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest2.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest2.xml b/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest2.xml
index 0e59ead..8fb11a9 100644
--- a/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest2.xml
+++ b/tests/integration-tests/src/test/resources/activemq-jms-for-JMSServerDeployerTest2.xml
@@ -2,52 +2,8 @@
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:activemq ../../src/schemas/activemq-jms.xsd ">
 
-   <connection-factory name="fullConfigurationConnectionFactory">
-      <entries>
-         <entry name="/fullConfigurationConnectionFactory"/>
-         <entry name="/acme/fullConfigurationConnectionFactory"/>
-         <entry name="java:/xyz/tfullConfigurationConnectionFactory"/>
-         <entry name="java:/connectionfactories/acme/fullConfigurationConnectionFactory"/>
-      </entries>
-      <connectors>
-         <connector-ref connector-name="netty"/>
-      </connectors>
-      <discovery-group-ref discovery-group-name="mygroup"/>
-      <client-failure-check-period>1234</client-failure-check-period>
-      <call-timeout>5678</call-timeout>
-      <consumer-window-size>12345</consumer-window-size>
-      <consumer-max-rate>6789</consumer-max-rate>
-      <confirmation-window-size>123456</confirmation-window-size>
-      <producer-window-size>7712652</producer-window-size>
-      <producer-max-rate>789</producer-max-rate>
-      <min-large-message-size>12</min-large-message-size>
-      <client-id>TestClientID</client-id>
-      <dups-ok-batch-size>3456</dups-ok-batch-size>
-      <transaction-batch-size>4567</transaction-batch-size>
-      <block-on-acknowledge>true</block-on-acknowledge>
-      <block-on-non-durable-send>false</block-on-non-durable-send>
-      <block-on-durable-send>true</block-on-durable-send>
-      <auto-group>false</auto-group>
-      <pre-acknowledge>true</pre-acknowledge>
-      <connection-ttl>2345</connection-ttl>
-      <failover-on-initial-connection>true</failover-on-initial-connection>
-      <failover-on-server-shutdown>false</failover-on-server-shutdown>
-      <connection-load-balancing-policy-class-name>FooClass</connection-load-balancing-policy-class-name>
-      <reconnect-attempts>34</reconnect-attempts>
-      <retry-interval>5</retry-interval>
-      <retry-interval-multiplier>6.0</retry-interval-multiplier>
-      <max-retry-interval>300</max-retry-interval>
-      <cache-large-message-client>true</cache-large-message-client>
-   </connection-factory>
+   <queue name="fullConfigurationQueue"/>
 
-   <queue name="fullConfigurationQueue">
-      <entry name="/fullConfigurationQueue"/>
-      <entry name="/queue/fullConfigurationQueue"/>
-   </queue>
-
-   <topic name="fullConfigurationTopic">
-      <entry name="/fullConfigurationTopic"/>
-      <entry name="/topic/fullConfigurationTopic"/>
-   </topic>
+   <topic name="fullConfigurationTopic"/>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config1.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config1.xml b/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config1.xml
index b57c8a5..00b7d07 100644
--- a/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config1.xml
+++ b/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config1.xml
@@ -1,18 +1,7 @@
 <configuration xmlns="urn:activemq"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-   <!--the connection factory used by the example-->
-   <connection-factory name="ConnectionFactory">
-      <connectors>
-         <connector-ref connector-name="netty-connector"/>
-      </connectors>
-      <entries>
-         <entry name="ConnectionFactory"/>
-      </entries>
-   </connection-factory>
    
-   <queue name="myJMSQueue">
-      <entry name="myJMSQueue"/>
-   </queue>
+   <queue name="myJMSQueue"/>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config2.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config2.xml b/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config2.xml
index b57c8a5..00b7d07 100644
--- a/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config2.xml
+++ b/tests/integration-tests/src/test/resources/colocated-server-start-stop-jms-config2.xml
@@ -1,18 +1,7 @@
 <configuration xmlns="urn:activemq"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-   <!--the connection factory used by the example-->
-   <connection-factory name="ConnectionFactory">
-      <connectors>
-         <connector-ref connector-name="netty-connector"/>
-      </connectors>
-      <entries>
-         <entry name="ConnectionFactory"/>
-      </entries>
-   </connection-factory>
    
-   <queue name="myJMSQueue">
-      <entry name="myJMSQueue"/>
-   </queue>
+   <queue name="myJMSQueue"/>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/server-start-stop-jms-config1.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/server-start-stop-jms-config1.xml b/tests/integration-tests/src/test/resources/server-start-stop-jms-config1.xml
index f2fb22c..5987e7e 100644
--- a/tests/integration-tests/src/test/resources/server-start-stop-jms-config1.xml
+++ b/tests/integration-tests/src/test/resources/server-start-stop-jms-config1.xml
@@ -1,18 +1,7 @@
 <configuration xmlns="urn:activemq"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-   <!--the connection factory used by the example-->
-   <connection-factory name="ConnectionFactory">
-      <connectors>
-         <connector-ref connector-name="netty-connector"/>
-      </connectors>
-      <entries>
-         <entry name="ConnectionFactory"/>
-      </entries>
-   </connection-factory>
    
-   <queue name="myJMSQueue">
-      <entry name="myJMSQueue"/>
-   </queue>
+   <queue name="myJMSQueue"/>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/spring-activemq-jms.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/spring-activemq-jms.xml b/tests/integration-tests/src/test/resources/spring-activemq-jms.xml
index bce97ab..3758989 100644
--- a/tests/integration-tests/src/test/resources/spring-activemq-jms.xml
+++ b/tests/integration-tests/src/test/resources/spring-activemq-jms.xml
@@ -1,19 +1,8 @@
 <configuration xmlns="urn:activemq"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
-    <!--the connection factory used by the example-->
-    <connection-factory name="ConnectionFactory">
-        <connectors>
-            <connector-ref connector-name="in-vm"/>
-        </connectors>
-        <entries>
-            <entry name="ConnectionFactory"/>
-        </entries>
-    </connection-factory>
 
     <!--the queue used by the example-->
-    <queue name="exampleQueue">
-        <entry name="/queue/exampleQueue"/>
-    </queue>
+    <queue name="exampleQueue"/>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/integration-tests/src/test/resources/spring-jms-beans.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/resources/spring-jms-beans.xml b/tests/integration-tests/src/test/resources/spring-jms-beans.xml
index 7dee319..38bb944 100644
--- a/tests/integration-tests/src/test/resources/spring-jms-beans.xml
+++ b/tests/integration-tests/src/test/resources/spring-jms-beans.xml
@@ -9,16 +9,29 @@
        <property name="jmsConfigResourcePath" value="spring-activemq-jms.xml"/>
    </bean>
 
+   <bean id="connectionFactory" class="org.apache.activemq.jms.client.ActiveMQJMSConnectionFactory">
+      <constructor-arg value="false" />
+      <constructor-arg>
+         <bean class="org.apache.activemq.api.core.TransportConfiguration">
+            <constructor-arg value="org.apache.activemq.core.remoting.impl.invm.InVMConnectorFactory" />
+         </bean>
+      </constructor-arg>
+   </bean>
+
+   <bean id="exampleQueue" class="org.apache.activemq.jms.client.ActiveMQQueue">
+      <constructor-arg index="0" value="exampleQueue"/>
+   </bean>
+
     <bean id="listener" class="org.apache.activemq.tests.integration.spring.ExampleListener"/>
     
     <bean id="MessageSender" class="org.apache.activemq.tests.integration.spring.MessageSender">
-        <property name="connectionFactory" ref="ConnectionFactory"/>
-        <property name="destination" ref="/queue/exampleQueue"/>
+        <property name="connectionFactory" ref="connectionFactory"/>
+        <property name="destination" ref="exampleQueue"/>
     </bean>
 
     <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
-        <property name="connectionFactory" ref="ConnectionFactory"/>
-        <property name="destination" ref="/queue/exampleQueue"/>
+        <property name="connectionFactory" ref="connectionFactory"/>
+        <property name="destination" ref="exampleQueue"/>
         <property name="messageListener" ref="listener"/>
     </bean>
     

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/jms-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/jms-tests/pom.xml b/tests/jms-tests/pom.xml
index e9a6aee..287a0da 100644
--- a/tests/jms-tests/pom.xml
+++ b/tests/jms-tests/pom.xml
@@ -79,10 +79,6 @@
          <artifactId>junit</artifactId>
       </dependency>
       <dependency>
-         <groupId>org.jboss.naming</groupId>
-         <artifactId>jnpserver</artifactId>
-      </dependency>
-      <dependency>
          <groupId>apache-logging</groupId>
          <artifactId>commons-logging</artifactId>
       </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/tests/jms-tests/src/test/java/org/apache/activemq/jms/tests/ActiveMQServerTestCase.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/jms/tests/ActiveMQServerTestCase.java b/tests/jms-tests/src/test/java/org/apache/activemq/jms/tests/ActiveMQServerTestCase.java
index 7bc2a0c..12247ea 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/jms/tests/ActiveMQServerTestCase.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/jms/tests/ActiveMQServerTestCase.java
@@ -39,6 +39,7 @@ import java.util.Set;
 
 import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
 import org.apache.activemq.api.core.SimpleString;
+import org.apache.activemq.api.jms.JMSFactoryType;
 import org.apache.activemq.core.postoffice.Binding;
 import org.apache.activemq.core.postoffice.impl.LocalQueueBinding;
 import org.apache.activemq.core.security.Role;
@@ -245,6 +246,9 @@ public abstract class ActiveMQServerTestCase
       createQueue("Queue2");
       createQueue("Queue3");
       createQueue("Queue4");
+      deployConnectionFactory(0, JMSFactoryType.CF, "ConnectionFactory", "/ConnectionFactory");
+      deployConnectionFactory(0, JMSFactoryType.TOPIC_CF, "CF_TOPIC", "/CF_TOPIC");
+      deployConnectionFactory(0, JMSFactoryType.XA_CF, "CF_XA_TRUE", "/CF_XA_TRUE");
    }
 
    private void lookUp() throws Exception
@@ -276,6 +280,10 @@ public abstract class ActiveMQServerTestCase
       destroyQueue("Queue2");
       destroyQueue("Queue3");
       destroyQueue("Queue4");
+
+      undeployConnectionFactory("ConnectionFactory");
+      undeployConnectionFactory("CF_TOPIC");
+      undeployConnectionFactory("CF_XA_TRUE");
    }
 
    @AfterClass
@@ -490,6 +498,11 @@ public abstract class ActiveMQServerTestCase
       ActiveMQServerTestCase.servers.get(server).deployConnectionFactory(objectName, jndiBindings);
    }
 
+   public static void deployConnectionFactory(final int server, JMSFactoryType type, final String objectName, final String... jndiBindings) throws Exception
+   {
+      ActiveMQServerTestCase.servers.get(server).deployConnectionFactory(objectName, type, jndiBindings);
+   }
+
    public void deployConnectionFactory(final String clientId,
                                        final String objectName,
                                        final int prefetchSize,
@@ -503,6 +516,7 @@ public abstract class ActiveMQServerTestCase
                                        final String... jndiBindings) throws Exception
    {
       ActiveMQServerTestCase.servers.get(0).deployConnectionFactory(clientId,
+                                                                   JMSFactoryType.CF,
                                                                    objectName,
                                                                    prefetchSize,
                                                                    defaultTempQueueFullSize,


Mime
View raw message