/** * Asserts that a {@link Deferred}, when it becomes available, * will eventually (after the default amount of time) satisfy the * specified {@link Matcher}. * * @param <T> the type of value produced by the {@link Deferred} * * @param deferred the {@link Deferred} * @param matcher the {@link Matcher} * * @throws AssertionError if the assertion fails */ public static <T> void assertThat(Deferred<T> deferred, Matcher<?> matcher) throws AssertionError { assertThat(null, deferred, matcher); }
/** * Asserts that a {@link Deferred}, when it becomes available, * will eventually (after the specified amount of time) satisfy the * specified {@link Matcher}. * * @param <T> the type of value produced by the {@link Deferred} * * @param deferred the {@link Deferred} * @param matcher the {@link Matcher} * @param totalRetryDuration the maximum duration for retrying * @param totalRetryDurationUnits the {@link TimeUnit}s for the duration * * @throws AssertionError if the assertion fails */ public static <T> void assertThat(Deferred<T> deferred, Matcher<?> matcher, long totalRetryDuration, TimeUnit totalRetryDurationUnits) throws AssertionError { assertThat(null, deferred, matcher, totalRetryDuration, totalRetryDurationUnits); }
/** * Asserts that a {@link Deferred}, when it becomes available, * will eventually (after the default amount of time) satisfy the * specified {@link Matcher}. * * @param <T> the type of value produced by the {@link Deferred} * * @param message the message for the AssertionError (<code>null</code> ok) * @param deferred the {@link Deferred} * @param matcher the {@link Matcher} * * @throws AssertionError if the assertion fails */ public static <T> void assertThat(String message, Deferred<T> deferred, Matcher<?> matcher) throws AssertionError { assertThat(message, deferred, matcher, DeferredHelper.ORACLETOOLS_DEFERRED_RETRY_TIMEOUT_SECS, TimeUnit.SECONDS); }
/** * Asserts that the specified {@link Callable} submitted to the {@link JavaApplication} * will eventually match the specified matcher. * * @param application * @param callable * @param matcher * @param <T> * * @throws AssertionError */ public static <T> void assertThat(JavaApplication<?> application, Callable<T> callable, Matcher<?> matcher) throws AssertionError { assertThat(new DeferredRemoteExecution<T>(application, callable), matcher); } }