Search in sources :

Example 1 with ResponsiveProducer

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)));
    }
}
Also used : ResponsiveProducer(teetime.stage.ResponsiveProducer) Execution(teetime.framework.Execution) Configuration(teetime.framework.Configuration) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Configuration (teetime.framework.Configuration)1 Execution (teetime.framework.Execution)1 ResponsiveProducer (teetime.stage.ResponsiveProducer)1