Search in sources :

Example 1 with MapEventConstructor

use of com.hazelcast.test.starter.constructor.MapEventConstructor 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

Member (com.hazelcast.cluster.Member)1 MapEvent (com.hazelcast.map.MapEvent)1 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 MapEventConstructor (com.hazelcast.test.starter.constructor.MapEventConstructor)1 Test (org.junit.Test)1