Search in sources :

Example 6 with EntryEvent

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

the class HazelcastReplicatedmapConsumerTest method testRemove.

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

Example 7 with EntryEvent

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

the class HazelcastReplicatedmapConsumerTest method testAdd.

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

Example 8 with EntryEvent

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

the class HazelcastMapConsumerTest method testEvict.

@Test
@SuppressWarnings("unchecked")
public void testEvict() throws InterruptedException {
    MockEndpoint out = 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(5000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.EVICTED);
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) EntryEvent(com.hazelcast.core.EntryEvent) Test(org.junit.Test)

Example 9 with EntryEvent

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

the class HazelcastMapConsumerTest method testRemove.

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

Example 10 with EntryEvent

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

the class HazelcastMapConsumerTest method testAdd.

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

Aggregations

EntryEvent (com.hazelcast.core.EntryEvent)71 Test (org.junit.Test)62 QuickTest (com.hazelcast.test.annotation.QuickTest)47 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)39 EntryAdapter (com.hazelcast.core.EntryAdapter)22 HazelcastInstance (com.hazelcast.core.HazelcastInstance)22 Config (com.hazelcast.config.Config)19 CountDownLatch (java.util.concurrent.CountDownLatch)19 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)18 AssertTask (com.hazelcast.test.AssertTask)15 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)15 MapListener (com.hazelcast.map.listener.MapListener)11 MapListenerAdapter (com.hazelcast.map.impl.MapListenerAdapter)10 MapConfig (com.hazelcast.config.MapConfig)9 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)8 Predicate (com.hazelcast.query.Predicate)8 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)8 ParallelTest (com.hazelcast.test.annotation.ParallelTest)8 EntryAddedListener (com.hazelcast.map.listener.EntryAddedListener)7 QueryCacheConfig (com.hazelcast.config.QueryCacheConfig)6