/** * Specify the executor service whose threads will be used to evaluate the poll condition in Awaitility. * Note that the executor service must be shutdown manually! * This is an advanced feature and it should only be used sparingly. * * @param executorService The executor service that Awaitility will use when polling condition evaluations * @since 3.0.0 */ public static void pollExecutorService(final ExecutorService executorService) { defaultExecutorLifecycle = ExecutorLifecycle.withoutCleanup(executorService); }
public static ExecutorLifecycle withoutCleanup(final ExecutorService executorService) { return withoutCleanup(new Supplier<ExecutorService>() { @Override public ExecutorService get() { return executorService; } }); }
/** * Specify the executor service whose threads will be used to evaluate the poll condition in Awaitility. * Note that the executor service must be shutdown manually! * * This is an advanced feature and it should only be used sparingly. * * @param executorService The executor service that Awaitility will use when polling condition evaluations * @return the condition factory */ public ConditionFactory pollExecutorService(ExecutorService executorService) { if (executorService != null && executorService instanceof ScheduledExecutorService) { throw new IllegalArgumentException("Poll executor service cannot be an instance of " + ScheduledExecutorService.class.getName()); } return new ConditionFactory(alias, timeoutConstraint, pollInterval, pollDelay, false, exceptionsIgnorer, conditionEvaluationListener, ExecutorLifecycle.withoutCleanup(executorService)); }
public static ExecutorLifecycle withoutCleanup(final ExecutorService executorService) { return withoutCleanup(new Supplier<ExecutorService>() { @Override public ExecutorService get() { return executorService; } }); }
/** * Specify the executor service whose threads will be used to evaluate the poll condition in Awaitility. * Note that the executor service must be shutdown manually! * This is an advanced feature and it should only be used sparingly. * * @param executorService The executor service that Awaitility will use when polling condition evaluations * @since 3.0.0 */ public static void pollExecutorService(final ExecutorService executorService) { defaultExecutorLifecycle = ExecutorLifecycle.withoutCleanup(executorService); }
/** * Specify the executor service whose threads will be used to evaluate the poll condition in Awaitility. * Note that the executor service must be shutdown manually! * * This is an advanced feature and it should only be used sparingly. * * @param executorService The executor service that Awaitility will use when polling condition evaluations * @return the condition factory */ public ConditionFactory pollExecutorService(ExecutorService executorService) { if (executorService != null && executorService instanceof ScheduledExecutorService) { throw new IllegalArgumentException("Poll executor service cannot be an instance of " + ScheduledExecutorService.class.getName()); } return new ConditionFactory(alias, timeoutConstraint, pollInterval, pollDelay, false, exceptionsIgnorer, conditionEvaluationListener, ExecutorLifecycle.withoutCleanup(executorService)); }