Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 71795 invoked from network); 23 Sep 2010 14:50:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Sep 2010 14:50:55 -0000 Received: (qmail 74996 invoked by uid 500); 23 Sep 2010 14:50:55 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 74924 invoked by uid 500); 23 Sep 2010 14:50:52 -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 74917 invoked by uid 99); 23 Sep 2010 14:50:51 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Sep 2010 14:50:51 +0000 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; Thu, 23 Sep 2010 14:50:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7062C23888EC; Thu, 23 Sep 2010 14:50:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1000486 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs Date: Thu, 23 Sep 2010 14:50:12 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100923145012.7062C23888EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Thu Sep 23 14:50:12 2010 New Revision: 1000486 URL: http://svn.apache.org/viewvc?rev=1000486&view=rev Log: Test the ConnectionFactory's URI handling directly. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs?rev=1000486&r1=1000485&r2=1000486&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs Thu Sep 23 14:50:12 2010 @@ -18,6 +18,7 @@ using System; using Apache.NMS.Test; +using Apache.NMS.Util; using Apache.NMS.ActiveMQ; using NUnit.Framework; @@ -27,6 +28,45 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class ConnectionFactoryTest : NMSTestSupport { + [Test] + [TestCase("tcp://${activemqhost}:61616")] + [TestCase("tcp://${activemqhost}:61616")] + [TestCase("tcp://${activemqhost}:61616/0.0.0.0:0")] + [TestCase("tcp://${activemqhost}:61616?connection.asyncclose=false")] + [TestCase("failover:tcp://${activemqhost}:61616")] + [TestCase("failover:(tcp://${activemqhost}:61616)")] + [TestCase("failover:(tcp://${activemqhost}:61616,tcp://${activemqhost}:61616)")] + [TestCase("failover://(tcp://${activemqhost}:61616)?transport.initialReconnectDelay=100")] + [TestCase("failover:(tcp://${activemqhost}:61616)?connection.asyncSend=true")] + [TestCase("failover:(tcp://${activemqhost}:61616)?transport.timeout=100&connection.asyncSend=true")] + [TestCase("failover:tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000")] + [TestCase("failover:(tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000)")] + [TestCase("failover:(tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000)?connection.asyncclose=false")] + [TestCase("failover:(tcp://${activemqhost}:61616?keepAlive=true&wireFormat.maxInactivityDuration=300000&wireFormat.tcpNoDelayEnabled=true)?initialReconnectDelay=100&randomize=false&timeout=15000")] + public void TestURI(string connectionURI) + { + { + Uri uri = URISupport.CreateCompatibleUri(NMSTestSupport.ReplaceEnvVar(connectionURI)); + ConnectionFactory factory = new ConnectionFactory(uri); + Assert.IsNotNull(factory); + using(IConnection connection = factory.CreateConnection("", "")) + { + Assert.IsNotNull(connection); + connection.Close(); + } + } + + { + ConnectionFactory factory = new ConnectionFactory(NMSTestSupport.ReplaceEnvVar(connectionURI)); + Assert.IsNotNull(factory); + using(IConnection connection = factory.CreateConnection("", "")) + { + Assert.IsNotNull(connection); + connection.Close(); + } + } + } + [Test, Sequential] public void TestConnectionFactorySetParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")]