Search in sources :

Example 16 with MapListener

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

the class MapPreconditionsTest method testAddEntryListenerWithMapListenerAndKey_NullListener.

@Test(expected = NullPointerException.class)
public void testAddEntryListenerWithMapListenerAndKey_NullListener() throws Exception {
    MapListener mapListener = null;
    Integer i = 3;
    map.addEntryListener(mapListener, i, false);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 17 with MapListener

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

the class MapPreconditionsTest method testAddLocalEntryListenerWithMapListenerAndPredicateAndKey_NullPredicate.

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

        public void onEntryEvent(EntryEvent event) {
            System.out.println("-");
        }
    };
    Predicate predicate = null;
    map.addLocalEntryListener(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 18 with MapListener

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

the class MapPreconditionsTest method testAddEntryListenerWithMapListener.

@Test(expected = NullPointerException.class)
public void testAddEntryListenerWithMapListener() throws Exception {
    MapListener mapListener = null;
    map.addEntryListener(mapListener, false);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 19 with MapListener

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

the class MapPreconditionsTest method testAddLocalEntryListenerWithMapListenerAndPredicate_NullPredicate.

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

        public void onEntryEvent(EntryEvent event) {
            System.out.println("-");
        }
    };
    Predicate predicate = null;
    map.addLocalEntryListener(mapListener, predicate, 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 20 with MapListener

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

the class MapPreconditionsTest method testAddEntryListenerWithMapListenerAndPredicate_NullListener.

@Test(expected = NullPointerException.class)
public void testAddEntryListenerWithMapListenerAndPredicate_NullListener() {
    MapListener mapListener = null;
    Predicate predicate = new TruePredicate();
    map.addEntryListener(mapListener, predicate, false);
}
Also used : MapListener(com.hazelcast.map.listener.MapListener) TruePredicate(com.hazelcast.query.TruePredicate) TruePredicate(com.hazelcast.query.TruePredicate) Predicate(com.hazelcast.query.Predicate) 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