Search in sources :

Example 11 with MapListener

use of com.hazelcast.map.listener.MapListener in project hazelcast by hazelcast.

the class MapPreconditionsTest method testAddEntryListenerWithMapListenerAndPredicateAndKey_NullPredicate.

@Test(expected = NullPointerException.class)
public void testAddEntryListenerWithMapListenerAndPredicateAndKey_NullPredicate() throws Exception {
    MapListener mapListener = new MapListenerAdapter() {

        public void onEntryEvent(EntryEvent event) {
            System.out.println("-");
        }
    };
    Predicate predicate = null;
    map.addEntryListener(mapListener, predicate, null, true);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) MapListenerAdapter(com.hazelcast.map.impl.MapListenerAdapter) EntryEvent(com.hazelcast.core.EntryEvent) Predicate(com.hazelcast.query.Predicate) TruePredicate(com.hazelcast.query.TruePredicate) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 12 with MapListener

use of com.hazelcast.map.listener.MapListener in project hazelcast by hazelcast.

the class MapPreconditionsTest method testAddLocalEntryListenerWithMapListenerAndPredicate_NullListener.

@Test(expected = UnsupportedOperationException.class)
public void testAddLocalEntryListenerWithMapListenerAndPredicate_NullListener() throws Exception {
    MapListener mapListener = null;
    Predicate predicate = new TruePredicate();
    map.addLocalEntryListener(mapListener, predicate, false);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) TruePredicate(com.hazelcast.query.TruePredicate) Predicate(com.hazelcast.query.Predicate) TruePredicate(com.hazelcast.query.TruePredicate) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 13 with MapListener

use of com.hazelcast.map.listener.MapListener in project hazelcast by hazelcast.

the class MapPreconditionsTest method testAddEntryListenerWithMapListenerAndKey_NullKey.

@Test(expected = NullPointerException.class)
public void testAddEntryListenerWithMapListenerAndKey_NullKey() throws Exception {
    MapListener mapListener = new MapListenerAdapter() {

        public void onEntryEvent(EntryEvent event) {
            System.out.println("-");
        }
    };
    map.addEntryListener(mapListener, null, false);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) MapListenerAdapter(com.hazelcast.map.impl.MapListenerAdapter) EntryEvent(com.hazelcast.core.EntryEvent) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 14 with MapListener

use of com.hazelcast.map.listener.MapListener in project hazelcast by hazelcast.

the class MapPreconditionsTest method testAddEntryListenerWithMapListenerAndPredicateAndKey_NullListener.

@Test(expected = NullPointerException.class)
public void testAddEntryListenerWithMapListenerAndPredicateAndKey_NullListener() throws Exception {
    MapListener mapListener = null;
    Predicate predicate = new TruePredicate();
    map.addEntryListener(mapListener, predicate, null, true);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) TruePredicate(com.hazelcast.query.TruePredicate) Predicate(com.hazelcast.query.Predicate) TruePredicate(com.hazelcast.query.TruePredicate) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 15 with MapListener

use of com.hazelcast.map.listener.MapListener in project hazelcast by hazelcast.

the class MapPreconditionsTest method testAddLocalEntryListenerWithMapListenerAndPredicateAndKey_NullListener.

@Test(expected = UnsupportedOperationException.class)
public void testAddLocalEntryListenerWithMapListenerAndPredicateAndKey_NullListener() throws Exception {
    MapListener mapListener = null;
    Predicate predicate = new TruePredicate();
    map.addLocalEntryListener(mapListener, predicate, null, false);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) TruePredicate(com.hazelcast.query.TruePredicate) Predicate(com.hazelcast.query.Predicate) TruePredicate(com.hazelcast.query.TruePredicate) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

MapListener (com.hazelcast.map.listener.MapListener)27 ParallelTest (com.hazelcast.test.annotation.ParallelTest)24 QuickTest (com.hazelcast.test.annotation.QuickTest)24 Test (org.junit.Test)24 Predicate (com.hazelcast.query.Predicate)16 TruePredicate (com.hazelcast.query.TruePredicate)16 EntryEvent (com.hazelcast.core.EntryEvent)10 MapListenerAdapter (com.hazelcast.map.impl.MapListenerAdapter)10 Config (com.hazelcast.config.Config)1 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 EntryEventFilter (com.hazelcast.map.impl.EntryEventFilter)1 QueryCacheEventService (com.hazelcast.map.impl.querycache.QueryCacheEventService)1 SqlPredicate (com.hazelcast.query.SqlPredicate)1 EventFilter (com.hazelcast.spi.EventFilter)1