use of net.dempsy.util.TestInfrastructure in project Dempsy by Dempsy.
the class TestOutputSchedulers method testCronSchedule.
/**
* Test cron schedule.
*
* @throws Exception the exception
*/
@Test
public void testCronSchedule() throws Exception {
try (final CronOutputSchedule cronOutputSchedule = new CronOutputSchedule("0/1 * * * * ?")) {
cronOutputSchedule.setOutputInvoker(container);
cronOutputSchedule.start(new TestInfrastructure(null));
assertTrue(poll(outputInvoked, oi -> oi.get()));
}
}
use of net.dempsy.util.TestInfrastructure in project Dempsy by Dempsy.
the class TestOutputSchedulers method testRelativeScheduleWithConcurrency.
/**
* Test relative schedule with concurrency.
*
* @throws Exception the exception
*/
@Test
public void testRelativeScheduleWithConcurrency() throws Exception {
try (final RelativeOutputSchedule relativeOutputSchedule = new RelativeOutputSchedule(1, TimeUnit.SECONDS)) {
relativeOutputSchedule.setOutputInvoker(container);
relativeOutputSchedule.start(new TestInfrastructure(null));
assertTrue(poll(outputInvoked, oi -> oi.get()));
}
}
Aggregations