NO-JIRA: [Java Client, AMQP 0-x] Remove SerialTest#testCorollary1 test.
The test seems ill-conceived.
* The number of iterations for s seems arbitrary (67108664 = 2^26 - 100)
* The values of n seem arbitrary (0+1, 512+1, 1024+1, 1536+1, ..., 3585)
* Though arbitrary the values of n have a very specific bit pattern of 10..01
* s is always incremented by 1024 leading to a very predictable bit pattern in s.
Namely the 10 least significant bits are always zero.
* Given the iteration count and the increment the same values of s are tested 16 times!!!
* Given the above it seems to not focus on interesting corner cases nor is it an exhaustive test.
In addition to all the above it runs for almost 5 minutes on my box accounting for 80% of all tests.
diff --git a/client/src/test/java/org/apache/qpid/util/SerialTest.java b/client/src/test/java/org/apache/qpid/util/SerialTest.java
index 08342da..24311c4 100644
--- a/client/src/test/java/org/apache/qpid/util/SerialTest.java
+++ b/client/src/test/java/org/apache/qpid/util/SerialTest.java
@@ -21,6 +21,9 @@
package org.apache.qpid.util;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.qpid.test.utils.QpidTestCase;
/**
@@ -43,36 +46,4 @@
assertTrue(Serial.gt(0xFFFFFFFF + 1, 0xFFFFFFFF));
assertTrue(Serial.lt(0xFFFFFFFF, 0xFFFFFFFF + 1));
}
-
- /**
- * Test the first Corollary of RFC 1982
- * For any sequence number s and any integer n such that addition of n
- * to s is well defined, (s + n) >= s. Further (s + n) == s only when
- * n == 0, in all other defined cases, (s + n) > s.
- */
- public void testCorollary1()
- {
- int wrapcount = 0;
-
- int s = 0;
-
- for (int i = 0; i < 67108664; i++)
- {
- for (int n = 1; n < 4096; n += 512)
- {
- assertTrue("Serial.gt returned false for: (" + (s + n) + " > " + s + "), n=" + n, Serial.gt(s + n, s));
- assertTrue("Serial.lt returned false for: (" + s + " < " + (s + n) + "), n=" + n, Serial.lt(s, s + n));
- }
-
- s += 1024;
-
- if (s == 0)
- {
- wrapcount += 1;
- }
- }
-
- assertTrue(wrapcount > 0);
- }
-
}