use of com.hazelcast.query.impl.QueryableEntry in project hazelcast by hazelcast.
the class QueryEventFilterTest method testEval_givenFilterContainsKey_whenKeyOfEntryIsNotEqual_thenReturnFalse.
@Test
public void testEval_givenFilterContainsKey_whenKeyOfEntryIsNotEqual_thenReturnFalse() {
//given
Data key1 = serializationService.toData("key1");
Predicate predicate = TruePredicate.INSTANCE;
QueryEventFilter filter = new QueryEventFilter(true, key1, predicate);
//when
Data key2 = serializationService.toData("key2");
QueryableEntry entry = mockEntryWithKeyData(key2);
//then
boolean result = filter.eval(entry);
assertFalse(result);
}
use of com.hazelcast.query.impl.QueryableEntry in project hazelcast by hazelcast.
the class NotEqualPredicateTest method apply_givenAttributeValueIsNull_whenEntryHasTheAttributeNull_thenReturnFalse.
@Test
public void apply_givenAttributeValueIsNull_whenEntryHasTheAttributeNull_thenReturnFalse() {
NotEqualPredicate name = new NotEqualPredicate("name", null);
QueryableEntry mockEntry = newMockEntry(null);
boolean result = name.apply(mockEntry);
assertFalse(result);
}
use of com.hazelcast.query.impl.QueryableEntry in project hazelcast by hazelcast.
the class NotEqualPredicateTest method apply_givenAttributeValueIsFoo_whenEntryHasEqualAttribute_thenReturnFalse.
@Test
public void apply_givenAttributeValueIsFoo_whenEntryHasEqualAttribute_thenReturnFalse() {
NotEqualPredicate name = new NotEqualPredicate("name", "foo");
QueryableEntry mockEntry = newMockEntry("foo");
boolean result = name.apply(mockEntry);
assertFalse(result);
}
use of com.hazelcast.query.impl.QueryableEntry in project hazelcast by hazelcast.
the class NotEqualPredicateTest method filter_givenAttributeNameIsFoo_whenTheFooFieldIsIndex_thenReturnsNullAndDoesNotTouchQueryContext.
@Test
public void filter_givenAttributeNameIsFoo_whenTheFooFieldIsIndex_thenReturnsNullAndDoesNotTouchQueryContext() {
/** see {@link #isIndexed_givenAttributeNameIsFoo_whenTheFooFieldIsIndexed_returnFalse()} */
String fieldName = "foo";
NotEqualPredicate predicate = new NotEqualPredicate(fieldName, "foo");
QueryContext queryContext = newMockContextWithIndex(fieldName);
Set<QueryableEntry> filter = predicate.filter(queryContext);
assertNull(filter);
verifyZeroInteractions(queryContext);
}
Aggregations