use of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener in project infinispan by infinispan.
the class ClientCustomEventsTest method testParameterBasedConversion.
public void testParameterBasedConversion() {
final DynamicCustomEventLogListener<Integer> l = new DynamicCustomEventLogListener<>(remoteCacheManager.getCache());
withClientListener(l, null, new Object[] { 2 }, remote -> {
l.expectNoEvents();
remote.put(1, "one");
l.expectCreatedEvent(new CustomEvent(1, "one", 0));
remote.put(2, "two");
l.expectCreatedEvent(new CustomEvent(2, null, 0));
});
}
use of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener in project infinispan by infinispan.
the class EmbeddedHotRodTest method testCustomEventsDynamic.
public void testCustomEventsDynamic() {
DynamicCustomEventLogListener<Integer> l = new DynamicCustomEventLogListener<>(cacheFactory.getHotRodCache());
withClientListener(l, null, new Object[] { 2 }, remote -> {
l.expectNoEvents();
remote.put(1, "one");
Cache<Integer, String> embedded = getEmbeddedCache();
assertEquals("one", embedded.get(1));
l.expectCreatedEvent(new CustomEvent(1, "one", 0));
remote.put(2, "two");
assertEquals("two", embedded.get(2));
l.expectCreatedEvent(new CustomEvent(2, null, 0));
remote.remove(1);
assertNull(embedded.get(1));
l.expectRemovedEvent(new CustomEvent(1, null, 0));
remote.remove(2);
assertNull(embedded.get(2));
l.expectRemovedEvent(new CustomEvent(2, null, 0));
});
}
use of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener in project infinispan by infinispan.
the class ClientCustomEventsTest method testConvertedNoEventsReplay.
public void testConvertedNoEventsReplay() {
RemoteCache<Integer, String> cache = remoteCacheManager.getCache();
StaticCustomEventLogListener staticEventListener = new StaticCustomEventLogListener<>(cache);
cache.put(1, "one");
withClientListener(staticEventListener, remote -> staticEventListener.expectNoEvents());
DynamicCustomEventLogListener dynamicEventListener = new DynamicCustomEventLogListener<>(cache);
cache.put(2, "two");
withClientListener(dynamicEventListener, null, new Object[] { 2 }, remote -> staticEventListener.expectNoEvents());
}
Aggregations