Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 97730 invoked from network); 14 Mar 2011 22:51:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Mar 2011 22:51:03 -0000 Received: (qmail 28330 invoked by uid 500); 14 Mar 2011 22:51:03 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 28301 invoked by uid 500); 14 Mar 2011 22:51:03 -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 28293 invoked by uid 99); 14 Mar 2011 22:51:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 22:51:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Mon, 14 Mar 2011 22:51:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2C78723888E7; Mon, 14 Mar 2011 22:50:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1081600 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src: main/csharp/PrefetchPolicy.cs test/csharp/NMSConnectionFactoryTest.cs Date: Mon, 14 Mar 2011 22:50:40 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110314225040.2C78723888E7@eris.apache.org> Author: tabish Date: Mon Mar 14 22:50:39 2011 New Revision: 1081600 URL: http://svn.apache.org/viewvc?rev=1081600&view=rev Log: merge part of the fix for https://issues.apache.org/jira/browse/AMQNET-318 Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/PrefetchPolicy.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/test/csharp/NMSConnectionFactoryTest.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/PrefetchPolicy.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/PrefetchPolicy.cs?rev=1081600&r1=1081599&r2=1081600&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/PrefetchPolicy.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/PrefetchPolicy.cs Mon Mar 14 22:50:39 2011 @@ -73,6 +73,11 @@ namespace Apache.NMS.ActiveMQ get { return this.maximumPendingMessageLimit; } set { this.maximumPendingMessageLimit = value; } } + + public int All + { + set { this.SetAll(value); } + } public void SetAll(int value) { Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/test/csharp/NMSConnectionFactoryTest.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/test/csharp/NMSConnectionFactoryTest.cs?rev=1081600&r1=1081599&r2=1081600&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/test/csharp/NMSConnectionFactoryTest.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/test/csharp/NMSConnectionFactoryTest.cs Mon Mar 14 22:50:39 2011 @@ -153,5 +153,32 @@ namespace Apache.NMS.ActiveMQ.Test connection.Close(); } } + + [Test] + [TestCase(0)] + [TestCase(1)] + [TestCase(1000)] + public void TestURIForPrefetchHandlingOfAll(int allPreFetch) + { + string testuri = string.Format("activemq:tcp://${{activemqhost}}:61616" + + "?nms.PrefetchPolicy.all={0}", allPreFetch); + + NMSConnectionFactory factory = new NMSConnectionFactory(NMSTestSupport.ReplaceEnvVar(testuri)); + + Assert.IsNotNull(factory); + Assert.IsNotNull(factory.ConnectionFactory); + using(IConnection connection = factory.CreateConnection("", "")) + { + Assert.IsNotNull(connection); + + Connection amqConnection = connection as Connection; + Assert.AreEqual(allPreFetch, amqConnection.PrefetchPolicy.QueuePrefetch); + Assert.AreEqual(allPreFetch, amqConnection.PrefetchPolicy.QueueBrowserPrefetch); + Assert.AreEqual(allPreFetch, amqConnection.PrefetchPolicy.TopicPrefetch); + Assert.AreEqual(allPreFetch, amqConnection.PrefetchPolicy.DurableTopicPrefetch); + + connection.Close(); + } + } } }