use of com.hazelcast.client.test.ringbuffer.filter.StartsWithStringFilter in project hazelcast by hazelcast.
the class RingbufferTest method readManyAsync_withFilter.
@Test
public void readManyAsync_withFilter() throws Exception {
serverRingbuffer.add("good1");
serverRingbuffer.add("bad1");
serverRingbuffer.add("good2");
serverRingbuffer.add("bad2");
serverRingbuffer.add("good3");
serverRingbuffer.add("bad3");
Future<ReadResultSet<String>> f = clientRingbuffer.readManyAsync(0, 3, 3, new StartsWithStringFilter("good")).toCompletableFuture();
ReadResultSet rs = f.get();
assertInstanceOf(ReadResultSetImpl.class, rs);
assertEquals(5, rs.readCount());
assertEquals("good1", rs.get(0));
assertEquals("good2", rs.get(1));
assertEquals("good3", rs.get(2));
}
use of com.hazelcast.client.test.ringbuffer.filter.StartsWithStringFilter in project hazelcast by hazelcast.
the class RingbufferTest method readManyAsync_withFilter_andMaxCount.
// checks if the max count works in combination with a filter.
// So if more results are available than needed, the surplus results should not be read.
@Test
public void readManyAsync_withFilter_andMaxCount() throws Exception {
serverRingbuffer.add("good1");
serverRingbuffer.add("bad1");
serverRingbuffer.add("good2");
serverRingbuffer.add("bad2");
serverRingbuffer.add("good3");
serverRingbuffer.add("bad3");
serverRingbuffer.add("good4");
serverRingbuffer.add("bad4");
Future<ReadResultSet<String>> f = clientRingbuffer.readManyAsync(0, 3, 3, new StartsWithStringFilter("good")).toCompletableFuture();
ReadResultSet rs = f.get();
assertInstanceOf(ReadResultSetImpl.class, rs);
assertEquals(5, rs.readCount());
assertEquals("good1", rs.get(0));
assertEquals("good2", rs.get(1));
assertEquals("good3", rs.get(2));
}
Aggregations