Search in sources :

Example 1 with RawStaticFilteredEventLogListener

use of org.infinispan.client.hotrod.event.EventLogListener.RawStaticFilteredEventLogListener in project infinispan by infinispan.

the class ComplexValue method testRawFilteredListeners.

@Test
public void testRawFilteredListeners() {
    remoteCache.clear();
    RemoteCache<Object, Object> jsonCache = this.remoteCache.withDataFormat(DataFormat.builder().keyType(APPLICATION_JSON).keyMarshaller(new UTF8StringMarshaller()).build());
    RawStaticFilteredEventLogListener<Object> l = new RawStaticFilteredEventLogListener<>(jsonCache);
    withClientListener(l, remote -> {
        jsonCache.put("{\"_type\":\"int32\",\"_value\":1}", Util.threadLocalRandomUUID().toString());
        l.expectNoEvents();
        jsonCache.put("{\"_type\":\"int32\",\"_value\":2}", Util.threadLocalRandomUUID().toString());
        l.expectOnlyCreatedEvent("\n{\n   \"_type\": \"int32\",\n   \"_value\": 2\n}\n");
    });
}
Also used : UTF8StringMarshaller(org.infinispan.commons.marshall.UTF8StringMarshaller) RawStaticFilteredEventLogListener(org.infinispan.client.hotrod.event.EventLogListener.RawStaticFilteredEventLogListener) Test(org.testng.annotations.Test) SingleHotRodServerTest(org.infinispan.client.hotrod.test.SingleHotRodServerTest)

Aggregations

RawStaticFilteredEventLogListener (org.infinispan.client.hotrod.event.EventLogListener.RawStaticFilteredEventLogListener)1 SingleHotRodServerTest (org.infinispan.client.hotrod.test.SingleHotRodServerTest)1 UTF8StringMarshaller (org.infinispan.commons.marshall.UTF8StringMarshaller)1 Test (org.testng.annotations.Test)1