Search in sources :

Example 11 with MapEvent

use of com.hazelcast.map.MapEvent in project hazelcast by hazelcast.

the class MapEventConstructorTest method testConstructor.

@Test
public void testConstructor() {
    String source = UuidUtil.newUnsecureUuidString();
    Member member = mock(Member.class);
    int eventType = EntryEventType.INVALIDATION.getType();
    MapEvent mapEvent = new MapEvent(source, member, eventType, 23);
    MapEventConstructor constructor = new MapEventConstructor(MapEvent.class);
    MapEvent clonedMapEvent = (MapEvent) constructor.createNew(mapEvent);
    assertEquals(mapEvent.getName(), clonedMapEvent.getName());
    assertEquals(mapEvent.getMember(), clonedMapEvent.getMember());
    assertEquals(mapEvent.getEventType(), clonedMapEvent.getEventType());
    assertEquals(mapEvent.getSource(), clonedMapEvent.getSource());
    assertEquals(mapEvent.getNumberOfEntriesAffected(), clonedMapEvent.getNumberOfEntriesAffected());
}
Also used : MapEvent(com.hazelcast.map.MapEvent) Member(com.hazelcast.cluster.Member) MapEventConstructor(com.hazelcast.test.starter.constructor.MapEventConstructor) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MapEvent (com.hazelcast.map.MapEvent)11 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)7 QuickTest (com.hazelcast.test.annotation.QuickTest)7 Test (org.junit.Test)7 CountDownLatch (java.util.concurrent.CountDownLatch)5 Member (com.hazelcast.cluster.Member)4 IMapEvent (com.hazelcast.map.IMapEvent)3 Config (com.hazelcast.config.Config)2 IMap (com.hazelcast.map.IMap)2 DataAwareEntryEvent (com.hazelcast.map.impl.DataAwareEntryEvent)2 MapEventData (com.hazelcast.map.impl.event.MapEventData)2 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)2 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)1 EntryAdapter (com.hazelcast.core.EntryAdapter)1 EntryEvent (com.hazelcast.core.EntryEvent)1 EntryEventType (com.hazelcast.core.EntryEventType)1 EntryListener (com.hazelcast.core.EntryListener)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 LocalReplicatedMapStatsImpl (com.hazelcast.internal.monitor.impl.LocalReplicatedMapStatsImpl)1 Data (com.hazelcast.internal.serialization.Data)1