154155156157158159160161162163164
// Test that everything we put in passes. for (int j = 0; j < 3; j++) { Tuple t1 = tf.newTuple(1); t1.set(0, 10 + j); assertTrue(bloom.exec(t1)); } // A few that don't pass for (int i = 100; i < 10; i++) { Tuple t2 = tf.newTuple(1);
161162163164165166167168169170171
// A few that don't pass for (int i = 100; i < 10; i++) { Tuple t2 = tf.newTuple(1); t2.set(0, i); assertFalse(bloom.exec(t2)); } } @Test public void testSingleKey() throws Exception {
207208209210211212213214215216217
// Test that everything we put in passes. for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Tuple t1 = tf.newTuple(1); t1.set(0, i * 10 + j); assertTrue(bloom.exec(t1)); } } // A few that don't pass for (int i = 100; i < 10; i++) {
215216217218219220221222223224225
// A few that don't pass for (int i = 100; i < 10; i++) { Tuple t1 = tf.newTuple(1); t1.set(0, i); assertFalse(bloom.exec(t1)); } } @Test public void testMultiKey() throws Exception {
270271272273274275276277278279280
for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Tuple t1 = tf.newTuple(2); t1.set(0, i * 10 + j); t1.set(1, strs[i][j]); assertTrue(bloom.exec(t1)); } } // A few that don't pass for (int i = 100; i < 10; i++) {
279280281282283284285286
// A few that don't pass for (int i = 100; i < 10; i++) { Tuple t1 = tf.newTuple(2); t1.set(0, i); t1.set(1, "ichabod"); assertFalse(bloom.exec(t1)); } }}