activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r548260 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/transport/failover/ test/java/org/apache/activemq/transport/failover/ test/java/org/apache/activemq/transport/tcp/
Date Mon, 18 Jun 2007 08:47:22 GMT
Author: aco
Date: Mon Jun 18 01:47:21 2007
New Revision: 548260

URL: http://svn.apache.org/viewvc?view=rev&rev=548260
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1071

Added:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java
Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransportFactory.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransportFactory.java?view=diff&rev=548260&r1=548259&r2=548260
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransportFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransportFactory.java
Mon Jun 18 01:47:21 2007
@@ -58,7 +58,11 @@
      * @throws IOException
      */
     public Transport createTransport(CompositeData compositData) throws IOException {
-        FailoverTransport transport = createTransport(compositData.getParameters());
+        Map options = compositData.getParameters();
+        FailoverTransport transport = createTransport(options);
+        if (!options.isEmpty()) {
+            throw new IllegalArgumentException("Invalid connect parameters: " + options);
+        }
         transport.add(compositData.getComponents());
         return transport;
     }

Added: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java?view=auto&rev=548260
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java
(added)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java
Mon Jun 18 01:47:21 2007
@@ -0,0 +1,29 @@
+/**
+ *
+ * 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.transport.failover;
+
+import org.apache.activemq.transport.tcp.TransportUriTest;
+
+public class FailoverUriTest extends TransportUriTest {
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        prefix = "failover:(";
+        postfix = ")?initialReconnectDelay=1000&maxReconnectDelay=1000";
+    }
+}

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java?view=diff&rev=548260&r1=548259&r2=548260
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java
Mon Jun 18 01:47:21 2007
@@ -28,11 +28,12 @@
  */
 public class TransportUriTest extends EmbeddedBrokerTestSupport {
 
-    private String postfix = "?tcpNoDelay=true&keepAlive=true";
-    private Connection connection;
+    protected String prefix = "";
+    protected String postfix = "?tcpNoDelay=true&keepAlive=true";
+    protected Connection connection;
 
     public void testUriOptionsWork() throws Exception {
-        String uri = bindAddress + postfix;
+        String uri = prefix + bindAddress + postfix;
 //        System.out.println("Connecting via: " + uri);
 
         connection = new ActiveMQConnectionFactory(uri).createConnection();
@@ -40,7 +41,7 @@
     }
 
     public void testBadVersionNumberDoesNotWork() throws Exception {
-        String uri = bindAddress + postfix + "&minmumWireFormatVersion=65535";
+        String uri = prefix + bindAddress + postfix + "&minmumWireFormatVersion=65535";
 //        System.out.println("Connecting via: " + uri);
 
         try {
@@ -54,7 +55,7 @@
 
 
     public void testBadPropertyNameFails() throws Exception {
-        String uri = bindAddress + postfix + "&cheese=abc";
+        String uri = prefix + bindAddress + postfix + "&cheese=abc";
 //        System.out.println("Connecting via: " + uri);
 
         try {
@@ -63,12 +64,13 @@
             fail("Should have thrown an exception!");
         }
         catch (Exception expected) {
+            expected.printStackTrace();
         }
     }
 
 
     protected void setUp() throws Exception {
-        bindAddress = "tcp://localhost:6161";
+        bindAddress = "tcp://localhost:61616";
         super.setUp();
     }
 



Mime
View raw message