use of io.crate.data.BatchConsumer in project crate by crate.
the class MultiConsumerTest method testSuccessfulMultiConsumerUsage.
@Test
public void testSuccessfulMultiConsumerUsage() throws Exception {
TestingBatchConsumer batchConsumer = new TestingBatchConsumer();
BatchConsumer consumer = new CompositeCollector.MultiConsumer(2, batchConsumer, CompositeBatchIterator::new);
consumer.accept(TestingBatchIterators.range(3, 6), null);
consumer.accept(TestingBatchIterators.range(0, 3), null);
List<Object[]> result = batchConsumer.getResult();
assertThat(TestingHelpers.printedTable(new CollectionBucket(result)), is("0\n" + "1\n" + "2\n" + "3\n" + "4\n" + "5\n"));
}
Aggregations