[hornetq-commits] JBoss hornetq SVN: r8990 - in trunk: tests/src/org/hornetq/tests/integration/jms/client and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Mar 29 00:37:21 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-03-29 00:37:20 -0400 (Mon, 29 Mar 2010)
New Revision: 8990

Added:
   trunk/tests/src/org/hornetq/tests/integration/jms/client/CreateCFTest.java
Modified:
   trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Log:
Fixing CF parsing from persistence

Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java	2010-03-29 03:50:20 UTC (rev 8989)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java	2010-03-29 04:37:20 UTC (rev 8990)
@@ -1543,7 +1543,7 @@
     */
    private List<Pair<TransportConfiguration, TransportConfiguration>> lookupConnectors(final ConnectionFactoryConfiguration cfConfig) throws HornetQException
    {
-      if (cfConfig.getConnectorConfigs() != null)
+      if (cfConfig.getConnectorConfigs() != null && cfConfig.getConnectorConfigs().size() > 0)
       {
          return cfConfig.getConnectorConfigs();
       }

Added: trunk/tests/src/org/hornetq/tests/integration/jms/client/CreateCFTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/client/CreateCFTest.java	                        (rev 0)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/client/CreateCFTest.java	2010-03-29 04:37:20 UTC (rev 8990)
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat 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.hornetq.tests.integration.jms.client;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Session;
+import javax.naming.NamingException;
+
+import org.hornetq.api.core.Pair;
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
+import org.hornetq.tests.util.JMSTestBase;
+
+/**
+ * A CreateCFTest
+ *
+ * @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class CreateCFTest extends JMSTestBase
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   protected boolean usePersistence()
+   {
+      return true;
+   }
+
+   public void testCreateCF() throws Exception
+   {
+      ConnectionFactoryConfigurationImpl factCFG = new ConnectionFactoryConfigurationImpl("tst");
+
+      ArrayList<Pair<String, String>> listStr = new ArrayList<Pair<String, String>>();
+      listStr.add(new Pair<String, String>("netty", null));
+
+      factCFG.setConnectorNames(listStr);
+
+      jmsServer.createConnectionFactory(factCFG, "/someCF");
+
+      openCon();
+
+      jmsServer.stop();
+
+      jmsServer.start();
+
+      openCon();
+
+      jmsServer.createConnectionFactory(factCFG, "/someCF");
+
+
+      openCon();
+
+
+      jmsServer.stop();
+
+   }
+
+   /**
+    * @throws NamingException
+    * @throws JMSException
+    */
+   private void openCon() throws NamingException, JMSException
+   {
+      ConnectionFactory cf = (ConnectionFactory)context.lookup("/someCF");
+
+      Connection conn = cf.createConnection();
+
+      conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      conn.close();
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}



More information about the hornetq-commits mailing list