Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 72206 invoked from network); 9 Sep 2010 20:33:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Sep 2010 20:33:54 -0000 Received: (qmail 66754 invoked by uid 500); 9 Sep 2010 20:33:54 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 66693 invoked by uid 500); 9 Sep 2010 20:33:53 -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 66686 invoked by uid 99); 9 Sep 2010 20:33:53 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 20:33:53 +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, 09 Sep 2010 20:33:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EEDA623889DA; Thu, 9 Sep 2010 20:33:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r995570 - in /activemq/activemq-dotnet: Apache.NMS.ActiveMQ/trunk/src/main/csharp/ Apache.NMS.ActiveMQ/trunk/src/test/csharp/ Apache.NMS.Stomp/trunk/src/main/csharp/ Apache.NMS.Stomp/trunk/src/test/csharp/ Date: Thu, 09 Sep 2010 20:33:13 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100909203313.EEDA623889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Thu Sep 9 20:33:13 2010 New Revision: 995570 URL: http://svn.apache.org/viewvc?rev=995570&view=rev Log: fix for: https://issues.apache.org/activemq/browse/AMQNET-281 Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NMSConnectionFactoryTest.cs activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/ConnectionFactory.cs activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/NMSConnectionFactoryTest.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs?rev=995570&r1=995569&r2=995570&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs Thu Sep 9 20:33:13 2010 @@ -164,10 +164,14 @@ namespace Apache.NMS.ActiveMQ set { brokerUri = new Uri(URISupport.StripPrefix(value.OriginalString, "activemq:")); - - if(brokerUri.Query != null) + + if(!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")")) { - StringDictionary properties = URISupport.ParseQuery(brokerUri.Query); + // Since the Uri class will return the end of a Query string found in a Composite + // URI we must ensure that we trim that off before we proceed. + string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")") + 1); + + StringDictionary properties = URISupport.ParseQuery(query); StringDictionary connection = URISupport.ExtractProperties(properties, "connection."); StringDictionary nms = URISupport.ExtractProperties(properties, "nms."); Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NMSConnectionFactoryTest.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NMSConnectionFactoryTest.cs?rev=995570&r1=995569&r2=995570&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NMSConnectionFactoryTest.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NMSConnectionFactoryTest.cs Thu Sep 9 20:33:13 2010 @@ -43,6 +43,9 @@ namespace Apache.NMS.ActiveMQ.Test [TestCase("activemq:failover://(tcp://${activemqhost}:61616)?transport.initialReconnectDelay=100")] [TestCase("activemq:failover:(tcp://${activemqhost}:61616)?connection.asyncSend=true")] [TestCase("activemq:failover:(tcp://${activemqhost}:61616)?transport.timeout=100&connection.asyncSend=true")] + [TestCase("activemq:failover:tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000")] + [TestCase("activemq:failover:(tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000)")] + [TestCase("activemq:failover:(tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000)?connection.asyncclose=false")] #if false [TestCase("activemq:discovery:multicast://default")] @@ -81,6 +84,7 @@ namespace Apache.NMS.ActiveMQ.Test using(IConnection connection = factory.CreateConnection("", "")) { Assert.IsNotNull(connection); + connection.Close(); } } @@ -105,6 +109,8 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsNotNull(this.info); Assert.AreEqual(username, info.UserName); Assert.AreEqual(password, info.Password); + + connection.Close(); } } @@ -143,7 +149,9 @@ namespace Apache.NMS.ActiveMQ.Test Assert.AreEqual(topicPrefetch, amqConnection.PrefetchPolicy.TopicPrefetch); Assert.AreEqual(durableTopicPrefetch, amqConnection.PrefetchPolicy.DurableTopicPrefetch); Assert.AreEqual(maximumPendingMessageLimit, amqConnection.PrefetchPolicy.MaximumPendingMessageLimit); - } + + connection.Close(); + } } } } Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/ConnectionFactory.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/ConnectionFactory.cs?rev=995570&r1=995569&r2=995570&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/ConnectionFactory.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/ConnectionFactory.cs Thu Sep 9 20:33:13 2010 @@ -160,9 +160,13 @@ namespace Apache.NMS.Stomp { brokerUri = new Uri(URISupport.StripPrefix(value.OriginalString, "stomp:")); - if(brokerUri.Query != null) + if(!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")")) { - StringDictionary properties = URISupport.ParseQuery(brokerUri.Query); + // Since the Uri class will return the end of a Query string found in a Composite + // URI we must ensure that we trim that off before we proceed. + string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")") + 1); + + StringDictionary properties = URISupport.ParseQuery(query); StringDictionary connection = URISupport.ExtractProperties(properties, "connection."); StringDictionary nms = URISupport.ExtractProperties(properties, "nms."); Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/NMSConnectionFactoryTest.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/NMSConnectionFactoryTest.cs?rev=995570&r1=995569&r2=995570&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/NMSConnectionFactoryTest.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/NMSConnectionFactoryTest.cs Thu Sep 9 20:33:13 2010 @@ -28,6 +28,8 @@ namespace Apache.NMS.Stomp.Test [Test] #if !NETCF [TestCase("stomp:tcp://${activemqhost}:61613")] + [TestCase("stomp:failover:(tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000)")] + [TestCase("stomp:failover:(tcp://${activemqhost}:61616?keepAlive=false&wireFormat.maxInactivityDuration=1000)?connection.asyncSend=false")] [TestCase("stomp:tcp://${activemqhost}:61613?connection.asyncsend=false")] [TestCase("stomp:tcp://${activemqhost}:61613?connection.InvalidParameter=true", ExpectedException = typeof(NMSConnectionException))] [TestCase("stomp:tcp://${activemqhost}:61613?connection.InvalidParameter=true", ExpectedException = typeof(NMSConnectionException))]