public class Eventually extends Object
Deferred values.
To customize assertion behavior and timeouts, this class allows extensive use
of Options. For example, the following Options may be used
to customize timeout constraints when asserting Deferred values;
Timeout, MaximumRetryDelay, Initial InitialDelay and
RetryFrequency.
Copyright (c) 2013. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Repetitively,
Concurrently| Constructor and Description |
|---|
Eventually() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
assertThat(JavaApplication application,
RemoteCallable<T> callable,
org.hamcrest.Matcher<? super T> matcher)
Asserts that the specified
RemoteCallable submitted to the
JavaApplication will eventually match the specified matcher
using the specified Options. |
static <T> void |
assertThat(JavaApplication application,
RemoteCallable<T> callable,
org.hamcrest.Matcher<? super T> matcher,
com.oracle.bedrock.Option... options)
Asserts that the specified
RemoteCallable submitted to
the JavaApplication will eventually satisfy the specified matcher
using the provided Options. |
static <T> void |
assertThat(String message,
com.oracle.bedrock.deferred.Deferred<T> deferred,
org.hamcrest.Matcher<? super T> matcher,
com.oracle.bedrock.Option... options)
Asserts that a
Deferred value, when it becomes available,
will eventually satisfy the specified Matcher
within the bounds of the provided Options. |
static <T> void |
assertThat(String message,
T value,
org.hamcrest.Matcher<? super T> matcher)
Asserts that a value will eventually satisfy the specified
Matcher. |
static <T> void |
assertThat(String message,
T value,
org.hamcrest.Matcher<? super T> matcher,
com.oracle.bedrock.Option... options)
Asserts that a value will eventually satisfy the specified
Matcher
using the provided Options. |
static <T> void |
assertThat(T value,
org.hamcrest.Matcher<? super T> matcher,
com.oracle.bedrock.Option... options)
Asserts that a value will eventually satisfy the specified
Matcher
using the specified Options. |
static com.oracle.bedrock.deferred.options.InitialDelay |
delayedBy(long duration,
TimeUnit units)
Obtains a
InitialDelay for the specified values. |
static com.oracle.bedrock.options.Timeout |
within(long duration,
TimeUnit units)
Obtains a
Timeout with the specified duration. |
public static <T> void assertThat(T value,
org.hamcrest.Matcher<? super T> matcher,
com.oracle.bedrock.Option... options)
throws AssertionError
Matcher
using the specified Options.
Should the value be the result of a call to DeferredHelper.invoking(Deferred)
the result is unwrapped into a Deferred that is then used for the assert.
T - the type of the valuevalue - the valuematcher - the Matcher for the valueoptions - the Options for the assertionAssertionError - if the assertion failspublic static <T> void assertThat(String message, T value, org.hamcrest.Matcher<? super T> matcher) throws AssertionError
Matcher.
Should the value be the result of a call to DeferredHelper.invoking(Deferred)
the result is unwrapped into a Deferred that is then used for the assert.
T - the type of the valuemessage - the message for the AssertionError (null ok)value - the valuematcher - the Matcher for the valueAssertionError - if the assertion failspublic static <T> void assertThat(String message, T value, org.hamcrest.Matcher<? super T> matcher, com.oracle.bedrock.Option... options) throws AssertionError
Matcher
using the provided Options.
Should the value be the result of a call to DeferredHelper.invoking(Deferred)
the result is unwrapped into a Deferred that is then used for the assert.
T - the type of the valuemessage - the message for the AssertionError (null ok)value - the valuematcher - the Matcher for the valueoptions - the OptionsAssertionError - if the assertion failspublic static <T> void assertThat(String message, com.oracle.bedrock.deferred.Deferred<T> deferred, org.hamcrest.Matcher<? super T> matcher, com.oracle.bedrock.Option... options) throws AssertionError
Deferred value, when it becomes available,
will eventually satisfy the specified Matcher
within the bounds of the provided Options.T - the type of the valuemessage - the message for the AssertionError (null ok)deferred - the Deferred valuematcher - the Matcher for the valueoptions - the OptionsAssertionError - if the assertion failspublic static <T> void assertThat(JavaApplication application, RemoteCallable<T> callable, org.hamcrest.Matcher<? super T> matcher) throws AssertionError
RemoteCallable submitted to the
JavaApplication will eventually match the specified matcher
using the specified Options.T - the type of the valueapplication - the JavaApplication to which the RemoteCallable will be submittedcallable - the RemoteCallablematcher - the Matcher representing the desire condition to matchAssertionError - if the assertion failspublic static <T> void assertThat(JavaApplication application, RemoteCallable<T> callable, org.hamcrest.Matcher<? super T> matcher, com.oracle.bedrock.Option... options) throws AssertionError
RemoteCallable submitted to
the JavaApplication will eventually satisfy the specified matcher
using the provided Options.T - the type of the valueapplication - the JavaApplication to which the RemoteCallable will be submittedcallable - the RemoteCallablematcher - the Matcher representing the desire condition to matchoptions - the OptionsAssertionError - if the assertion failspublic static com.oracle.bedrock.options.Timeout within(long duration,
TimeUnit units)
Timeout with the specified duration.duration - the durationunits - the duration unitsTimeoutpublic static com.oracle.bedrock.deferred.options.InitialDelay delayedBy(long duration,
TimeUnit units)
InitialDelay for the specified values.duration - the delay durationunits - the delay duration unitsInitialDelayCopyright © 2017. All rights reserved.