activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
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 GMT
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);
+    }
 }



Mime
View raw message