activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r831620 - /activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/RedeliveryPolicyTest.cs
Date Sat, 31 Oct 2009 23:48:24 GMT
Author: tabish
Date: Sat Oct 31 23:48:24 2009
New Revision: 831620

URL: http://svn.apache.org/viewvc?rev=831620&view=rev
Log:
* RedeliveryPolicyTest.cs: 

Update the test for new changes

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=831620&r1=831619&r2=831620&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 Sat
Oct 31 23:48:24 2009
@@ -20,16 +20,16 @@
             policy.UseExponentialBackOff = true;
 
             // simulate a retry of 10 times
-            Assert.IsTrue(policy.RedeliveryDelay(0) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
-            Assert.IsTrue(policy.RedeliveryDelay(1) == 10, "redelivery delay not 10 is "
+ policy.RedeliveryDelay(1));
-            Assert.IsTrue(policy.RedeliveryDelay(2) == 20, "redelivery delay not 20 is "
+ policy.RedeliveryDelay(2));
-            Assert.IsTrue(policy.RedeliveryDelay(3) == 40, "redelivery delay not 40 is "
+ policy.RedeliveryDelay(3));
-            Assert.IsTrue(policy.RedeliveryDelay(4) == 80, "redelivery delay not 80 is "
+ policy.RedeliveryDelay(4));
-            Assert.IsTrue(policy.RedeliveryDelay(5) == 160, "redelivery delay not 160 is
" + policy.RedeliveryDelay(5));
-            Assert.IsTrue(policy.RedeliveryDelay(6) == 320, "redelivery delay not 320 is
" + policy.RedeliveryDelay(6));
-            Assert.IsTrue(policy.RedeliveryDelay(7) == 640, "redelivery delay not 640 is
" + policy.RedeliveryDelay(7));
-            Assert.IsTrue(policy.RedeliveryDelay(8) == 1280, "redelivery delay not 1280 is
" + policy.RedeliveryDelay(8));
-            Assert.IsTrue(policy.RedeliveryDelay(9) == 2560, "redelivery delay not 2560 is
" + policy.RedeliveryDelay(9));
+            Assert.IsTrue(policy.RedeliveryDelay(0) == 0, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
+            Assert.IsTrue(policy.RedeliveryDelay(1) == 5, "redelivery delay not 10 is " +
policy.RedeliveryDelay(1));
+            Assert.IsTrue(policy.RedeliveryDelay(2) == 10, "redelivery delay not 20 is "
+ policy.RedeliveryDelay(2));
+            Assert.IsTrue(policy.RedeliveryDelay(3) == 20, "redelivery delay not 40 is "
+ policy.RedeliveryDelay(3));
+            Assert.IsTrue(policy.RedeliveryDelay(4) == 40, "redelivery delay not 80 is "
+ policy.RedeliveryDelay(4));
+            Assert.IsTrue(policy.RedeliveryDelay(5) == 80, "redelivery delay not 160 is "
+ policy.RedeliveryDelay(5));
+            Assert.IsTrue(policy.RedeliveryDelay(6) == 160, "redelivery delay not 320 is
" + policy.RedeliveryDelay(6));
+            Assert.IsTrue(policy.RedeliveryDelay(7) == 320, "redelivery delay not 640 is
" + policy.RedeliveryDelay(7));
+            Assert.IsTrue(policy.RedeliveryDelay(8) == 640, "redelivery delay not 1280 is
" + policy.RedeliveryDelay(8));
+            Assert.IsTrue(policy.RedeliveryDelay(9) == 1280, "redelivery delay not 2560 is
" + policy.RedeliveryDelay(9));
         }
 
         [Test]
@@ -42,16 +42,16 @@
             policy.UseExponentialBackOff = true;
 
             // simulate a retry of 10 times
-            Assert.IsTrue(policy.RedeliveryDelay(0) == 3, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
-            Assert.IsTrue(policy.RedeliveryDelay(1) == 9, "redelivery delay not 10 is " +
policy.RedeliveryDelay(1));
-            Assert.IsTrue(policy.RedeliveryDelay(2) == 27, "redelivery delay not 20 is "
+ policy.RedeliveryDelay(2));
-            Assert.IsTrue(policy.RedeliveryDelay(3) == 81, "redelivery delay not 40 is "
+ policy.RedeliveryDelay(3));
-            Assert.IsTrue(policy.RedeliveryDelay(4) == 243, "redelivery delay not 80 is "
+ policy.RedeliveryDelay(4));
-            Assert.IsTrue(policy.RedeliveryDelay(5) == 729, "redelivery delay not 160 is
" + policy.RedeliveryDelay(5));
-            Assert.IsTrue(policy.RedeliveryDelay(6) == 2187, "redelivery delay not 320 is
" + policy.RedeliveryDelay(6));
-            Assert.IsTrue(policy.RedeliveryDelay(7) == 6561, "redelivery delay not 640 is
" + policy.RedeliveryDelay(7));
-            Assert.IsTrue(policy.RedeliveryDelay(8) == 19683, "redelivery delay not 1280
is " + policy.RedeliveryDelay(8));
-            Assert.IsTrue(policy.RedeliveryDelay(9) == 59049, "redelivery delay not 2560
is " + policy.RedeliveryDelay(9));
+            Assert.IsTrue(policy.RedeliveryDelay(0) == 0, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
+            Assert.IsTrue(policy.RedeliveryDelay(1) == 3, "redelivery delay not 10 is " +
policy.RedeliveryDelay(1));
+            Assert.IsTrue(policy.RedeliveryDelay(2) == 9, "redelivery delay not 20 is " +
policy.RedeliveryDelay(2));
+            Assert.IsTrue(policy.RedeliveryDelay(3) == 27, "redelivery delay not 40 is "
+ policy.RedeliveryDelay(3));
+            Assert.IsTrue(policy.RedeliveryDelay(4) == 81, "redelivery delay not 80 is "
+ policy.RedeliveryDelay(4));
+            Assert.IsTrue(policy.RedeliveryDelay(5) == 243, "redelivery delay not 160 is
" + policy.RedeliveryDelay(5));
+            Assert.IsTrue(policy.RedeliveryDelay(6) == 729, "redelivery delay not 320 is
" + policy.RedeliveryDelay(6));
+            Assert.IsTrue(policy.RedeliveryDelay(7) == 2187, "redelivery delay not 640 is
" + policy.RedeliveryDelay(7));
+            Assert.IsTrue(policy.RedeliveryDelay(8) == 6561, "redelivery delay not 1280 is
" + policy.RedeliveryDelay(8));
+            Assert.IsTrue(policy.RedeliveryDelay(9) == 19683, "redelivery delay not 2560
is " + policy.RedeliveryDelay(9));
         }
 
         [Test]
@@ -62,16 +62,16 @@
             policy.InitialRedeliveryDelay = 5;
 
             // simulate a retry of 10 times
-            Assert.IsTrue(policy.RedeliveryDelay(0) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(0));
-            Assert.IsTrue(policy.RedeliveryDelay(1) == 5, "redelivery delay not 10 is " +
policy.RedeliveryDelay(1));
-            Assert.IsTrue(policy.RedeliveryDelay(2) == 5, "redelivery delay not 20 is " +
policy.RedeliveryDelay(2));
-            Assert.IsTrue(policy.RedeliveryDelay(3) == 5, "redelivery delay not 40 is " +
policy.RedeliveryDelay(3));
-            Assert.IsTrue(policy.RedeliveryDelay(4) == 5, "redelivery delay not 80 is " +
policy.RedeliveryDelay(4));
-            Assert.IsTrue(policy.RedeliveryDelay(5) == 5, "redelivery delay not 160 is "
+ policy.RedeliveryDelay(5));
-            Assert.IsTrue(policy.RedeliveryDelay(6) == 5, "redelivery delay not 320 is "
+ policy.RedeliveryDelay(6));
-            Assert.IsTrue(policy.RedeliveryDelay(7) == 5, "redelivery delay not 640 is "
+ policy.RedeliveryDelay(7));
-            Assert.IsTrue(policy.RedeliveryDelay(8) == 5, "redelivery delay not 1280 is "
+ policy.RedeliveryDelay(8));
-            Assert.IsTrue(policy.RedeliveryDelay(9) == 5, "redelivery delay not 2560 is "
+ policy.RedeliveryDelay(9));
+            Assert.IsTrue(policy.RedeliveryDelay(0) == 0, "redelivery delay not 0 is " +
policy.RedeliveryDelay(0));
+            Assert.IsTrue(policy.RedeliveryDelay(1) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(1));
+            Assert.IsTrue(policy.RedeliveryDelay(2) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(2));
+            Assert.IsTrue(policy.RedeliveryDelay(3) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(3));
+            Assert.IsTrue(policy.RedeliveryDelay(4) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(4));
+            Assert.IsTrue(policy.RedeliveryDelay(5) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(5));
+            Assert.IsTrue(policy.RedeliveryDelay(6) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(6));
+            Assert.IsTrue(policy.RedeliveryDelay(7) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(7));
+            Assert.IsTrue(policy.RedeliveryDelay(8) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(8));
+            Assert.IsTrue(policy.RedeliveryDelay(9) == 5, "redelivery delay not 5 is " +
policy.RedeliveryDelay(9));
         }
 
         [Test]
@@ -97,25 +97,27 @@
 
             // simulate a retry of 10 times
             int delay = policy.RedeliveryDelay(0);
-            Assert.IsTrue(delay >= 4.5 && delay <= 5.5, "not delay >= 4.5
&& delay <= 5.5 is " + policy.RedeliveryDelay(0));
+            Assert.IsTrue(delay == 0, "not zero is " + policy.RedeliveryDelay(0));
             delay = policy.RedeliveryDelay(1);
-            Assert.IsTrue(delay >= 9 && delay <= 11, "not delay >= 9 &&
delay <= 11 is " + policy.RedeliveryDelay(1));
+            Assert.IsTrue(delay >= 4.5 && delay <= 5.5, "not delay >= 4.5
&& delay <= 5.5 is " + policy.RedeliveryDelay(1));
             delay = policy.RedeliveryDelay(2);
-            Assert.IsTrue(delay >= 18 && delay <= 22, "not delay >= 18 &&
delay <= 22 is " + policy.RedeliveryDelay(2));
+            Assert.IsTrue(delay >= 9 && delay <= 11, "not delay >= 9 &&
delay <= 11 is " + policy.RedeliveryDelay(2));
             delay = policy.RedeliveryDelay(3);
-            Assert.IsTrue(delay >= 36 && delay <= 44, "not delay >= 36 &&
delay <= 44 is " + policy.RedeliveryDelay(3));
+            Assert.IsTrue(delay >= 18 && delay <= 22, "not delay >= 18 &&
delay <= 22 is " + policy.RedeliveryDelay(3));
             delay = policy.RedeliveryDelay(4);
-            Assert.IsTrue(delay >= 72 && delay <= 88, "not delay >= 72 &&
delay <= 88 is " + policy.RedeliveryDelay(4));
+            Assert.IsTrue(delay >= 36 && delay <= 44, "not delay >= 36 &&
delay <= 44 is " + policy.RedeliveryDelay(4));
             delay = policy.RedeliveryDelay(5);
-            Assert.IsTrue(delay >= 144 && delay <= 176, "not delay >= 144
&& delay <= 176 is " + policy.RedeliveryDelay(5));
+            Assert.IsTrue(delay >= 72 && delay <= 88, "not delay >= 72 &&
delay <= 88 is " + policy.RedeliveryDelay(5));
             delay = policy.RedeliveryDelay(6);
-            Assert.IsTrue(delay >= 288 && delay <= 352, "not delay >= 288
&& delay <= 352 is " + policy.RedeliveryDelay(6));
+            Assert.IsTrue(delay >= 144 && delay <= 176, "not delay >= 144
&& delay <= 176 is " + policy.RedeliveryDelay(6));
             delay = policy.RedeliveryDelay(7);
-            Assert.IsTrue(delay >= 576 && delay <= 704, "not delay >= 576
&& delay <= 704 is " + policy.RedeliveryDelay(7));
+            Assert.IsTrue(delay >= 288 && delay <= 352, "not delay >= 288
&& delay <= 352 is " + policy.RedeliveryDelay(7));
             delay = policy.RedeliveryDelay(8);
-            Assert.IsTrue(delay >= 1152 && delay <= 1408, "not delay >=
1152 && delay <= 1408 is " + policy.RedeliveryDelay(8));
+            Assert.IsTrue(delay >= 576 && delay <= 704, "not delay >= 576
&& delay <= 704 is " + policy.RedeliveryDelay(8));
             delay = policy.RedeliveryDelay(9);
-            Assert.IsTrue(delay >= 2304 && delay <= 2816, "not delay >=
2304 && delay <= 2816 is " + policy.RedeliveryDelay(9));
+            Assert.IsTrue(delay >= 1152 && delay <= 1408, "not delay >=
1152 && delay <= 1408 is " + policy.RedeliveryDelay(9));
+            delay = policy.RedeliveryDelay(10);
+            Assert.IsTrue(delay >= 2304 && delay <= 2816, "not delay >=
2304 && delay <= 2816 is " + policy.RedeliveryDelay(10));
         }
     }
 }



Mime
View raw message