T - type of the query result@NotThreadSafe public interface TimedQuery<T> extends PollingQuery
Represents a repeatable query over the state of the test that results in an object instance of a particular type
T. The query may be evaluated immediately (now(), or within some timeout
(byDefaultTimeout(), by(long), by(long, java.util.concurrent.TimeUnit)).
Usually there is a specific value of T expected by the query and it will not return until the
underlying query evaluates to this expected value, or the timeout expires.
The specific semantics of how the polling is performed are up to implementations of this interface and should be
documented appropriately. E.g. a particular implementation may be waiting for a specific value t of T,
and returning the real value s, if the query does not return t within the given timeout. Other
implementations may throw exceptions, or return null, if an expected query result value is not returned
within timeout, etc.
DEFAULT_INTERVAL| Modifier and Type | Method and Description |
|---|---|
T |
by(long timeoutInMillis)
Evaluate this query by given timeout.
|
T |
by(long timeout,
TimeUnit unit)
Evaluate this query by given timeout.
|
T |
byDefaultTimeout()
Evaluate this query by a timeout deemed default by this query.
|
T |
now()
Evaluate this query immediately.
|
defaultTimeout, intervalT byDefaultTimeout()
PollingQuery.defaultTimeout()T by(long timeoutInMillis)
null, or throw exceptiontimeoutInMillis - timeout in milliseconds (must be greater than 0)T by(long timeout, TimeUnit unit)
null, or throw exceptiontimeout - timeout (must be greater than 0)unit - the unit that the timeout is inT now()
Copyright © 2016 Atlassian. All rights reserved.