/** * {@inheritDoc} */ @Override public void uncaughtException(Thread thread, Throwable throwable) { if (!conditionSettings.shouldExceptionBeIgnored(throwable)) { uncaughtThrowable.set(throwable); // We shutdown the executor "now" in order to fail the test immediately conditionSettings.getExecutorLifecycle().executeUnexpectedCleanupBehavior(executor); } }
/** * <p>Constructor for ConditionAwaiter.</p> * * @param conditionEvaluator a {@link ConditionEvaluator} object. * @param conditionSettings a {@link org.awaitility.core.ConditionSettings} object. */ ConditionAwaiter(final ConditionEvaluator conditionEvaluator, final ConditionSettings conditionSettings) { if (conditionEvaluator == null) { throw new IllegalArgumentException("You must specify a condition (was null)."); } if (conditionSettings == null) { throw new IllegalArgumentException("You must specify the condition settings (was null)."); } if (conditionSettings.shouldCatchUncaughtExceptions()) { Thread.setDefaultUncaughtExceptionHandler(this); } this.conditionSettings = conditionSettings; this.conditionEvaluator = conditionEvaluator; this.executor = conditionSettings.getExecutorLifecycle().supplyExecutorService(); this.uncaughtThrowable = new AtomicReference<Throwable>(); }
} finally { uncaughtThrowable.set(null); conditionSettings.getExecutorLifecycle().executeNormalCleanupBehavior(executor);
/** * {@inheritDoc} */ @Override public void uncaughtException(Thread thread, Throwable throwable) { if (!conditionSettings.shouldExceptionBeIgnored(throwable)) { uncaughtThrowable.set(throwable); // We shutdown the executor "now" in order to fail the test immediately conditionSettings.getExecutorLifecycle().executeUnexpectedCleanupBehavior(executor); } }
/** * <p>Constructor for ConditionAwaiter.</p> * * @param conditionEvaluator a {@link ConditionEvaluator} object. * @param conditionSettings a {@link org.awaitility.core.ConditionSettings} object. */ ConditionAwaiter(final ConditionEvaluator conditionEvaluator, final ConditionSettings conditionSettings) { if (conditionEvaluator == null) { throw new IllegalArgumentException("You must specify a condition (was null)."); } if (conditionSettings == null) { throw new IllegalArgumentException("You must specify the condition settings (was null)."); } if (conditionSettings.shouldCatchUncaughtExceptions()) { Thread.setDefaultUncaughtExceptionHandler(this); } this.conditionSettings = conditionSettings; this.conditionEvaluator = conditionEvaluator; this.executor = conditionSettings.getExecutorLifecycle().supplyExecutorService(); this.uncaughtThrowable = new AtomicReference<Throwable>(); }
} finally { uncaughtThrowable.set(null); conditionSettings.getExecutorLifecycle().executeNormalCleanupBehavior(executor);