Search in sources :

Example 56 with EntryEvent

use of com.hazelcast.core.EntryEvent in project camel by apache.

the class HazelcastMapConsumerTest method testUpdate.

@Test
@SuppressWarnings("unchecked")
public void testUpdate() throws InterruptedException {
    MockEndpoint out = getMockEndpoint("mock:updated");
    out.expectedMessageCount(1);
    EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.UPDATED.getType(), "4711", "my-foo");
    argument.getValue().entryUpdated(event);
    assertMockEndpointsSatisfied(5000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.UPDATED);
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) EntryEvent(com.hazelcast.core.EntryEvent) Test(org.junit.Test)

Example 57 with EntryEvent

use of com.hazelcast.core.EntryEvent in project camel by apache.

the class HazelcastMapConsumerTest method testEnict.

@Test
@SuppressWarnings("unchecked")
public void testEnict() throws InterruptedException {
    MockEndpoint out = super.getMockEndpoint("mock:evicted");
    out.expectedMessageCount(1);
    EntryEvent<Object, Object> event = new EntryEvent<Object, Object>("foo", null, EntryEventType.EVICTED.getType(), "4711", "my-foo");
    argument.getValue().entryEvicted(event);
    assertMockEndpointsSatisfied(30000, TimeUnit.MILLISECONDS);
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) EntryEvent(com.hazelcast.core.EntryEvent) Test(org.junit.Test)

Aggregations

EntryEvent (com.hazelcast.core.EntryEvent)57 Test (org.junit.Test)49 QuickTest (com.hazelcast.test.annotation.QuickTest)38 ParallelTest (com.hazelcast.test.annotation.ParallelTest)37 EntryAdapter (com.hazelcast.core.EntryAdapter)21 CountDownLatch (java.util.concurrent.CountDownLatch)19 HazelcastInstance (com.hazelcast.core.HazelcastInstance)17 Config (com.hazelcast.config.Config)15 AssertTask (com.hazelcast.test.AssertTask)11 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)11 MapListenerAdapter (com.hazelcast.map.impl.MapListenerAdapter)10 MapListener (com.hazelcast.map.listener.MapListener)10 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)9 Predicate (com.hazelcast.query.Predicate)8 TruePredicate (com.hazelcast.query.TruePredicate)8 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)7 MapConfig (com.hazelcast.config.MapConfig)7 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)6 MapEvent (com.hazelcast.core.MapEvent)5 MaxSizeConfig (com.hazelcast.config.MaxSizeConfig)4