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();
+ }
+ }
}
}