Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 53682 invoked from network); 13 Feb 2009 13:49:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2009 13:49:25 -0000 Received: (qmail 95612 invoked by uid 500); 13 Feb 2009 13:49:22 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 95599 invoked by uid 500); 13 Feb 2009 13:49:22 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 95391 invoked by uid 99); 13 Feb 2009 13:49:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 05:49:21 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 13:49:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5AA0523889B2; Fri, 13 Feb 2009 13:48:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r744112 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq: EmbeddedBrokerTestSupport.java transport/failover/FailoverUriTest.java transport/tcp/TransportUriTest.java Date: Fri, 13 Feb 2009 13:48:52 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090213134852.5AA0523889B2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dejanb Date: Fri Feb 13 13:48:51 2009 New Revision: 744112 URL: http://svn.apache.org/viewvc?rev=744112&view=rev Log: refactored failover uri test to support testing multiple values Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java?rev=744112&r1=744111&r2=744112&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java Fri Feb 13 13:48:51 2009 @@ -32,7 +32,7 @@ * * @version $Revision: 1.1 $ */ -public abstract class EmbeddedBrokerTestSupport extends TestCase { +public abstract class EmbeddedBrokerTestSupport extends CombinationTestSupport { protected BrokerService broker; // protected String bindAddress = "tcp://localhost:61616"; Modified: 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?rev=744112&r1=744111&r2=744112&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverUriTest.java Fri Feb 13 13:48:51 2009 @@ -16,13 +16,29 @@ */ package org.apache.activemq.transport.failover; +import junit.framework.Test; + 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"; + + public void initCombosForTestUriOptionsWork() { + addCombinationValues("prefix", new Object[] {"failover:("}); + addCombinationValues("postfix", new Object[] {")?initialReconnectDelay=1000&maxReconnectDelay=1000"}); + //, "?jms.useAsyncSend=true&jms.copyMessageOnSend=false &wireFormat.tightEncodingEnabled=false"}); + } + + public void initCombosForTestBadVersionNumberDoesNotWork() { + addCombinationValues("prefix", new Object[] {"failover:("}); + addCombinationValues("postfix", new Object[] {")?initialReconnectDelay=1000&maxReconnectDelay=1000"}); + } + + public void initCombosForTestBadPropertyNameFails() { + addCombinationValues("prefix", new Object[] {"failover:("}); + addCombinationValues("postfix", new Object[] {")?initialReconnectDelay=1000&maxReconnectDelay=1000"}); + } + + public static Test suite() { + return suite(FailoverUriTest.class); } } 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?rev=744112&r1=744111&r2=744112&view=diff ============================================================================== --- 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 Fri Feb 13 13:48:51 2009 @@ -19,30 +19,47 @@ import javax.jms.Connection; import javax.jms.JMSException; +import junit.framework.Test; + import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.EmbeddedBrokerTestSupport; import org.apache.activemq.broker.BrokerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * @version $Revision$ */ public class TransportUriTest extends EmbeddedBrokerTestSupport { - protected String prefix = ""; - protected String postfix = "?tcpNoDelay=true&keepAlive=true"; + private static final Log LOG = LogFactory.getLog(TransportUriTest.class); + protected Connection connection; + + public String prefix; + public String postfix; + + public void initCombosForTestUriOptionsWork() { + addCombinationValues("prefix", new Object[] {""}); + addCombinationValues("postfix", new Object[] {"?tcpNoDelay=true&keepAlive=true"}); + } public void testUriOptionsWork() throws Exception { String uri = prefix + bindAddress + postfix; - // System.out.println("Connecting via: " + uri); + LOG.info("Connecting via: " + uri); connection = new ActiveMQConnectionFactory(uri).createConnection(); connection.start(); } + + public void initCombosForTestBadVersionNumberDoesNotWork() { + addCombinationValues("prefix", new Object[] {""}); + addCombinationValues("postfix", new Object[] {"?tcpNoDelay=true&keepAlive=true"}); + } public void testBadVersionNumberDoesNotWork() throws Exception { String uri = prefix + bindAddress + postfix + "&minmumWireFormatVersion=65535"; - // System.out.println("Connecting via: " + uri); + LOG.info("Connecting via: " + uri); try { connection = new ActiveMQConnectionFactory(uri).createConnection(); @@ -52,9 +69,14 @@ } } + public void initCombosForTestBadPropertyNameFails() { + addCombinationValues("prefix", new Object[] {""}); + addCombinationValues("postfix", new Object[] {"?tcpNoDelay=true&keepAlive=true"}); + } + public void testBadPropertyNameFails() throws Exception { String uri = prefix + bindAddress + postfix + "&cheese=abc"; - // System.out.println("Connecting via: " + uri); + LOG.info("Connecting via: " + uri); try { connection = new ActiveMQConnectionFactory(uri).createConnection(); @@ -87,4 +109,8 @@ answer.addConnector(bindAddress); return answer; } + + public static Test suite() { + return suite(TransportUriTest.class); + } }