use of com.hazelcast.query.impl.predicates.InstanceOfPredicate in project hazelcast by hazelcast.
the class ReplicatedMapListenerTest method testListenToKeyWithPredicate.
@Test
public void testListenToKeyWithPredicate() throws Exception {
ReplicatedMap<Object, Object> replicatedMap = createClusterAndGetRandomReplicatedMap();
final EventCountingListener listener = new EventCountingListener();
replicatedMap.addEntryListener(listener, new InstanceOfPredicate(Integer.class), 2);
replicatedMap.put(1, 1);
replicatedMap.put(2, 2);
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
assertEquals(1, listener.keys.size());
assertEquals(2, listener.keys.peek());
assertEquals(1, listener.addCount.get());
}
});
}
use of com.hazelcast.query.impl.predicates.InstanceOfPredicate in project hazelcast by hazelcast.
the class ClientMapTest method testSerializationServiceNullClassLoaderProblem.
@Test
public void testSerializationServiceNullClassLoaderProblem() throws Exception {
IMap<Integer, SampleObjects.PortableEmployee> map = client.getMap("test");
// If the classloader is null the following call throws NullPointerException
map.values(new InstanceOfPredicate(SampleObjects.PortableEmployee.class));
}
Aggregations