@Test public void singleFixedDelayTaskWithException() { final Future<Integer> future = scheduledService.singleFixedDelayTask(1, "Planned exception"); try { future.get(200, TimeUnit.MILLISECONDS); } catch (ExecutionException e) { assertEquals("Planned exception", e.getCause().getMessage()); } catch (Exception e) { fail("Unexpected exception" + e); } }
public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); } }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }  }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }  Future<Integer> singleFixedDelayTask(final int value,
                                                final String errorMessage); ScheduledFuture<?> periodicFixedDelayTask(final int value,
                                                     final String errorMessage,
                                                     final CountDownLatch countDownLatch); }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }  Future<Integer> singleFixedDelayTask(final int value,
                                                final String errorMessage); ScheduledFuture<?> periodicFixedDelayTask(final int value,
                                                     final String errorMessage,
                                                     final CountDownLatch countDownLatch);  }