Repository: cassandra Updated Branches: refs/heads/trunk b32ce687e -> 93b365cdc
fix CRC32Ex unit test when JDK < 1.8 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/93b365cd Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/93b365cd Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/93b365cd Branch: refs/heads/trunk Commit: 93b365cdcff34418bdac56473997f0a6d2b2aaaf Parents: b32ce68 Author: Benedict Elliott Smith <[email protected]> Authored: Wed Mar 4 00:26:41 2015 +0000 Committer: Benedict Elliott Smith <[email protected]> Committed: Wed Mar 4 00:26:41 2015 +0000 ---------------------------------------------------------------------- test/unit/org/apache/cassandra/utils/CRC32FactoryTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/93b365cd/test/unit/org/apache/cassandra/utils/CRC32FactoryTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/utils/CRC32FactoryTest.java b/test/unit/org/apache/cassandra/utils/CRC32FactoryTest.java index a55fbf0..2187cb9 100644 --- a/test/unit/org/apache/cassandra/utils/CRC32FactoryTest.java +++ b/test/unit/org/apache/cassandra/utils/CRC32FactoryTest.java @@ -55,6 +55,9 @@ public class CRC32FactoryTest private void testOnce() { + if (Float.parseFloat(System.getProperty("java.version").substring(0, 3)) < 1.8) + return; + final long seed = System.nanoTime(); System.out.println("Seed is " + seed); Random r = new java.util.Random(seed); @@ -112,9 +115,9 @@ public class CRC32FactoryTest @Test public void jdkDetection() { - if (System.getProperty("java.version").startsWith("1.7")) - assertFalse(CRC32Factory.create() instanceof CRC32Factory.CRC32Ex); - else + if (Float.parseFloat(System.getProperty("java.version").substring(0, 3)) >= 1.8) assertTrue(CRC32Factory.create() instanceof CRC32Factory.CRC32Ex); + else + assertFalse(CRC32Factory.create() instanceof CRC32Factory.CRC32Ex); } }
