Search in sources :

Example 1 with ItemEvent

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

the class HazelcastListConsumerTest method add.

@Test
@SuppressWarnings("unchecked")
public void add() throws InterruptedException {
    MockEndpoint out = getMockEndpoint("mock:added");
    out.expectedMessageCount(1);
    final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.ADDED, "foo", null);
    argument.getValue().itemAdded(event);
    assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.ADDED);
}
Also used : ItemEvent(com.hazelcast.core.ItemEvent) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Example 2 with ItemEvent

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

the class HazelcastListConsumerTest method remove.

@Test
@SuppressWarnings("unchecked")
public void remove() throws InterruptedException {
    MockEndpoint out = getMockEndpoint("mock:removed");
    out.expectedMessageCount(1);
    final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.REMOVED, "foo", null);
    argument.getValue().itemRemoved(event);
    assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED);
}
Also used : ItemEvent(com.hazelcast.core.ItemEvent) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Example 3 with ItemEvent

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

the class HazelcastSetConsumerTest method add.

@Test
@SuppressWarnings("unchecked")
public void add() throws InterruptedException {
    MockEndpoint out = getMockEndpoint("mock:added");
    out.expectedMessageCount(1);
    final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.ADDED, "foo", null);
    argument.getValue().itemAdded(event);
    assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.ADDED);
}
Also used : ItemEvent(com.hazelcast.core.ItemEvent) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Example 4 with ItemEvent

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

the class HazelcastSetConsumerTest method remove.

@Test
@SuppressWarnings("unchecked")
public void remove() throws InterruptedException {
    MockEndpoint out = getMockEndpoint("mock:removed");
    out.expectedMessageCount(1);
    final ItemEvent<String> event = new ItemEvent<String>("mm", ItemEventType.REMOVED, "foo", null);
    argument.getValue().itemRemoved(event);
    assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED);
}
Also used : ItemEvent(com.hazelcast.core.ItemEvent) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Example 5 with ItemEvent

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

the class HazelcastQueueConsumerTest method remove.

@Test
@SuppressWarnings("unchecked")
public void remove() throws InterruptedException {
    MockEndpoint out = getMockEndpoint("mock:removed");
    out.expectedMessageCount(1);
    final ItemEvent<String> event = new ItemEvent<String>("foo", ItemEventType.REMOVED, "foo", null);
    argument.getValue().itemRemoved(event);
    assertMockEndpointsSatisfied(2000, TimeUnit.MILLISECONDS);
    this.checkHeaders(out.getExchanges().get(0).getIn().getHeaders(), HazelcastConstants.REMOVED);
}
Also used : ItemEvent(com.hazelcast.core.ItemEvent) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Aggregations

ItemEvent (com.hazelcast.core.ItemEvent)14 Test (org.junit.Test)9 ItemListener (com.hazelcast.core.ItemListener)6 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)6 DataAwareItemEvent (com.hazelcast.collection.impl.common.DataAwareItemEvent)5 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)3 Data (com.hazelcast.nio.serialization.Data)3 ParallelTest (com.hazelcast.test.annotation.ParallelTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 MemberImpl (com.hazelcast.instance.MemberImpl)2 ClientEndpoint (com.hazelcast.client.ClientEndpoint)1 QueueService (com.hazelcast.collection.impl.queue.QueueService)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1