activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r831114 - /activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs
Date Thu, 29 Oct 2009 22:13:45 GMT
Author: tabish
Date: Thu Oct 29 22:13:45 2009
New Revision: 831114

URL: http://svn.apache.org/viewvc?rev=831114&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-137

Added IRedeliveryPolicy to NMS along with a default Redelivery policy for NMS providers to
use in their IConnectionFactory implementations.  Added the use of the default policy to NMS.ActiveMQ
and used that policy to control the redelivery delay in the MessageConsumers rollback method.

Modified:
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs

Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs?rev=831114&r1=831113&r2=831114&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs Thu
Oct 29 22:13:45 2009
@@ -13,8 +13,11 @@
         [Test]
         public void Executes_redelivery_policy_with_backoff_enabled_correctly()
         {
-            RedeliveryPolicy policy = new RedeliveryPolicy
-                             {BackOffMultiplier = 2, InitialRedeliveryDelay = 5, UseExponentialBackOff
= true};
+            RedeliveryPolicy policy = new RedeliveryPolicy();
+
+            policy.BackOffMultiplier = 2;
+            policy.InitialRedeliveryDelay = 5;
+            policy.UseExponentialBackOff = true;
 
             // simulate a retry of 10 times
             Assert.IsTrue(policy.RedeliveryDelay(0) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
@@ -32,7 +35,11 @@
         [Test]
         public void Executes_redelivery_policy_with_backoff_of_3_enabled_correctly()
         {
-            RedeliveryPolicy policy = new RedeliveryPolicy { BackOffMultiplier = 3, InitialRedeliveryDelay
= 3, UseExponentialBackOff = true };
+            RedeliveryPolicy policy = new RedeliveryPolicy();
+
+            policy.BackOffMultiplier = 3;
+            policy.InitialRedeliveryDelay = 3;
+            policy.UseExponentialBackOff = true;
 
             // simulate a retry of 10 times
             Assert.IsTrue(policy.RedeliveryDelay(0) == 3, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
@@ -50,7 +57,9 @@
         [Test]
         public void Executes_redelivery_policy_without_backoff_enabled_correctly()
         {
-            RedeliveryPolicy policy = new RedeliveryPolicy { InitialRedeliveryDelay = 5 };
+            RedeliveryPolicy policy = new RedeliveryPolicy();
+
+            policy.InitialRedeliveryDelay = 5;
 
             // simulate a retry of 10 times
             Assert.IsTrue(policy.RedeliveryDelay(0) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
@@ -78,7 +87,13 @@
         [Test]
         public void Executes_redelivery_policy_with_collision_enabled_correctly()
         {
-            RedeliveryPolicy policy = new RedeliveryPolicy { BackOffMultiplier = 2, InitialRedeliveryDelay
= 5, UseExponentialBackOff = true, UseCollisionAvoidance = true, CollisionAvoidancePercent
= 10 };
+            RedeliveryPolicy policy = new RedeliveryPolicy();
+
+            policy.BackOffMultiplier = 2;
+            policy.InitialRedeliveryDelay = 5;
+            policy.UseExponentialBackOff = true;
+            policy.UseCollisionAvoidance = true;
+            policy.CollisionAvoidancePercent = 10;
 
             // simulate a retry of 10 times
             var delay = policy.RedeliveryDelay(0);



Mime
View raw message