@PublicApi public final class Poller extends Object
PollingQuery.PollingQuery,
TimedQuery,
TimedCondition| Modifier and Type | Class and Description |
|---|---|
static class |
Poller.WaitTimeout |
| Modifier and Type | Method and Description |
|---|---|
static Poller.WaitTimeout |
by(long timeoutInMillis)
Custom assertion timeout expressed in milliseconds.
|
static Poller.WaitTimeout |
by(long timeout,
TimeUnit unit)
Custom assertion timeout expressed in a number of time units.
|
static Poller.WaitTimeout |
byDefaultTimeout()
Timeout indicating that the assertion method will wait for the default timeout of exercised timed query for
the condition to become
true. |
static Poller.WaitTimeout |
now()
Timeout indicating that the assertion method will evaluate the assertion condition immediately, without waiting.
|
static <T> T |
waitUntil(String message,
TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by
default timeout of the query.
|
static <T> T |
waitUntil(String message,
TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher,
Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by
given timeout.
|
static <T> T |
waitUntil(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by
default timeout of the query.
|
static <T> T |
waitUntil(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher,
Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by
given timeout.
|
static <T> T |
waitUntilEquals(String message,
T expectedValue,
TimedQuery<T> query)
Wait until given query evaluates to actual value that is equal to expectedValue by default timeout,
with custom error message.
|
static <T> T |
waitUntilEquals(T expectedValue,
TimedQuery<T> query)
Wait until given query evaluates to actual value that is equal to expectedValue
by default timeout.
|
static void |
waitUntilFalse(String message,
TimedQuery<Boolean> condition)
Wait until given condition is
false by default timeout, with custom error message. |
static void |
waitUntilFalse(TimedQuery<Boolean> condition)
Wait until given condition is
false by default timeout |
static void |
waitUntilTrue(String message,
TimedQuery<Boolean> condition)
Wait until given condition is
true by default timeout, with custom error message. |
static void |
waitUntilTrue(TimedQuery<Boolean> condition)
Wait until given condition is
true by default timeout |
public static void waitUntilTrue(TimedQuery<Boolean> condition)
true by default timeoutcondition - condition to exercisepublic static void waitUntilTrue(String message, TimedQuery<Boolean> condition)
true by default timeout, with custom error message.message - error messagecondition - condition to exercisepublic static void waitUntilFalse(TimedQuery<Boolean> condition)
false by default timeoutcondition - condition to exercisepublic static void waitUntilFalse(String message, TimedQuery<Boolean> condition)
false by default timeout, with custom error message.message - error messagecondition - condition to exercisepublic static <T> T waitUntilEquals(T expectedValue,
TimedQuery<T> query)
expectedValue - expected valuequery - query to evaluatepublic static <T> T waitUntilEquals(String message, T expectedValue, TimedQuery<T> query)
message - error messageexpectedValue - expected valuequery - query to evaluatepublic static <T> T waitUntil(TimedQuery<T> query, org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by default timeout of the query.
Use any matcher from the available libraries (e.g. Hamcrest, JUnit etc.), or a custom one.
query - timed query to evaluatematcher - a matcher representing the assertion conditionMatcher,
Matcherspublic static <T> T waitUntil(String message, TimedQuery<T> query, org.hamcrest.Matcher<? super T> matcher)
Wait until given query fulfils certain condition specified by the matcher, by default timeout of the query.
Use any matcher from the available libraries (e.g. Hamcrest, JUnit etc.), or a custom one.
message - message displayed in case of failurequery - timed query to evaluatematcher - a matcher representing the assertion conditionMatcher,
Matcherspublic static <T> T waitUntil(TimedQuery<T> query, org.hamcrest.Matcher<? super T> matcher, Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by given timeout.
Use any matcher from the available libraries (e.g. Hamcrest, JUnit etc.), or a custom one.
To specify desired timeout, use one of four provided timeouts: now(), byDefaultTimeout(),
#by(long), by(long, java.util.concurrent.TimeUnit).
query - timed query to evaluatematcher - a matcher representing the assertion conditiontimeout - time limit for this waitMatcher,
Matchers,
now(),
by(long),
by(long, java.util.concurrent.TimeUnit),
byDefaultTimeout()public static <T> T waitUntil(String message, TimedQuery<T> query, org.hamcrest.Matcher<? super T> matcher, Poller.WaitTimeout timeout)
Wait until given query fulfils certain condition specified by given the matcher, by given timeout.
Use any matcher from the libraries available (e.g. Hamcrest, JUnit etc.), or a custom one.
To specify desired timeout, use one of four provided timeouts: now(), byDefaultTimeout(),
#by(long), by(long, java.util.concurrent.TimeUnit).
message - message displayed for failed assertionquery - timed query to verifymatcher - a matcher representing the assertion conditiontimeout - timeout of the assertionMatcher,
Matchers,
now(),
by(long),
by(long, java.util.concurrent.TimeUnit),
byDefaultTimeout()public static Poller.WaitTimeout now()
public static Poller.WaitTimeout byDefaultTimeout()
true.public static Poller.WaitTimeout by(long timeoutInMillis)
TimedAssertions.by(500L);
passed to an assertion method will make it wait 500 milliseconds for given condition to become true.timeoutInMillis - number of milliseconds to wait for the assertion conditionpublic static Poller.WaitTimeout by(long timeout, TimeUnit unit)
TimedAssertions.by(5, TimeUnit.SECONDS);
passed to an assertion method will make it wait 5 seconds for given condition to become true.timeout - timeout countunit - unit of the timeoutCopyright © 2015 Atlassian. All rights reserved.