use of com.hazelcast.function.Functions in project hazelcast by hazelcast.
the class SlidingWindowP_CoGroupTest method test.
@Test
@SuppressWarnings("unchecked")
public void test() {
SupplierEx supplier = Processors.aggregateToSlidingWindowP(asList(Functions.<String>entryKey(), entryKey()), asList(t -> 1L, t -> 1L), TimestampKind.FRAME, tumblingWinPolicy(1), 0L, aggregateOperation2(AggregateOperations.<Entry<String, String>>toList(), AggregateOperations.<Entry<String, String>>toList()), (start, end, key, result, isEarly) -> result(end, key, result.f0(), result.f1()));
Entry<String, String> entry1 = entry("k1", "a");
Entry<String, String> entry2 = entry("k2", "b");
Entry<String, String> entry3 = entry("k1", "c");
Entry<String, String> entry4 = entry("k3", "d");
Entry<String, String> entry5 = entry("k1", "e");
TestSupport.verifyProcessor(supplier).inputs(asList(asList(entry1, entry2), asList(entry3, entry4, entry5))).expectOutput(asList(result(1, "k1", singletonList(entry1), asList(entry3, entry5)), result(1, "k2", singletonList(entry2), emptyList()), result(1, "k3", emptyList(), singletonList(entry4))));
}
Aggregations