use of teetime.stage.ResponsiveProducer in project TeeTime by teetime-framework.
the class MultipleExecutionsProducerIT method testRegularExecution.
void testRegularExecution(final List<String> expectedElements, final int numThreads) {
for (int numOfExecutions = 1; numOfExecutions < expectedElements.size() + 1; numOfExecutions++) {
List<String> actualElements = new ArrayList<>();
Configuration configuration = new Configuration().from(new ResponsiveProducer<String>(expectedElements)).end(new CollectorSink<String>(actualElements));
GlobalTaskPoolScheduling scheduler = new GlobalTaskPoolScheduling(numThreads, configuration, numOfExecutions);
Execution<Configuration> execution = new Execution<>(configuration, true, scheduler);
execution.executeBlocking();
assertThat("failed with numOfExecutions=" + numOfExecutions, actualElements, is(equalTo(expectedElements)));
}
}
Aggregations