You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2014/06/13 23:15:40 UTC

git commit: Use RandomStringGenerator instead of WordGenerator so BitSetTest passes on windows.

Repository: cassandra
Updated Branches:
  refs/heads/trunk 305132946 -> 8ff5262f0


Use RandomStringGenerator instead of WordGenerator so BitSetTest passes
on windows.

Patch by Ala' Alkhaldi, reviewed by Joshua McKenzie for CASSANDRA-7060


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8ff5262f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8ff5262f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8ff5262f

Branch: refs/heads/trunk
Commit: 8ff5262f0d77ce9b350cdde599bf847f9f28a395
Parents: 3051329
Author: Brandon Williams <br...@apache.org>
Authored: Fri Jun 13 16:14:42 2014 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Fri Jun 13 16:14:42 2014 -0500

----------------------------------------------------------------------
 test/unit/org/apache/cassandra/utils/BitSetTest.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8ff5262f/test/unit/org/apache/cassandra/utils/BitSetTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/BitSetTest.java b/test/unit/org/apache/cassandra/utils/BitSetTest.java
index e9f9211..59bc5e4 100644
--- a/test/unit/org/apache/cassandra/utils/BitSetTest.java
+++ b/test/unit/org/apache/cassandra/utils/BitSetTest.java
@@ -29,7 +29,7 @@ import org.junit.Test;
 
 import org.junit.Assert;
 import org.apache.cassandra.io.util.DataOutputBuffer;
-import org.apache.cassandra.utils.KeyGenerator.WordGenerator;
+import org.apache.cassandra.utils.KeyGenerator.RandomStringGenerator;
 import org.apache.cassandra.utils.obs.IBitSet;
 import org.apache.cassandra.utils.obs.OffHeapBitSet;
 import org.apache.cassandra.utils.obs.OpenBitSet;
@@ -44,10 +44,10 @@ public class BitSetTest
     @Test
     public void compareBitSets()
     {
-        BloomFilter bf2 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, false);
-        BloomFilter bf3 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, true);
-        int skipEven = KeyGenerator.WordGenerator.WORDS % 2 == 0 ? 0 : 2;
-        WordGenerator gen1 = new KeyGenerator.WordGenerator(skipEven, 2);
+        BloomFilter bf2 = (BloomFilter) FilterFactory.getFilter(FilterTestHelper.ELEMENTS / 2, FilterTestHelper.MAX_FAILURE_RATE, false);
+        BloomFilter bf3 = (BloomFilter) FilterFactory.getFilter(FilterTestHelper.ELEMENTS / 2, FilterTestHelper.MAX_FAILURE_RATE, true);
+
+        RandomStringGenerator gen1 = new KeyGenerator.RandomStringGenerator(new Random().nextInt(), FilterTestHelper.ELEMENTS);
 
         // make sure both bitsets are empty.
         compare(bf2.bitset, bf3.bitset);