T - the end implementation of DefaultWaiting as the return type for setter methodspublic class Wait extends Object implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_INTERVAL |
static long |
DEFAULT_TIMEOUT
Default waiting timeout
|
| Constructor and Description |
|---|
Wait() |
| Modifier and Type | Method and Description |
|---|---|
Wait |
dontFail()
Sets no failure after waiting timeout.
|
protected void |
fail()
Tries to fail by throwing 'failure' throwable.
|
Wait |
failWith(CharSequence failureMessage,
Object... arguments)
Returns preset instance of waiting with given failure message parametrized by given objects.
|
Wait |
failWith(Exception exception)
Returns Waiting object initialized with given exception.
|
protected long |
getInterval()
Returns the interval set for this object.
|
protected long |
getTimeout()
Returns the timeout set for this object.
|
Wait |
interval(long interval)
Returns instance of waiting with same properties like this object and interval set to given interval.
|
protected boolean |
isDelayed()
Returns if this waiting's start is delayed.
|
Wait |
noDelay()
Sets no delay between start of waiting and first test for conditions.
|
Wait |
timeout(long timeout)
Returns instance of waiting with same properties like this object and timeout set to given timeout.
|
void |
until(Condition condition)
Stars loop waiting to satisfy condition.
|
Wait |
withDelay(boolean isDelayed)
Set if testing condition should be delayed of one interval after the start of waiting.
|
public static final long DEFAULT_INTERVAL
public static final long DEFAULT_TIMEOUT
protected long getInterval()
protected long getTimeout()
protected boolean isDelayed()
public Wait interval(long interval)
interval - in milliseconds that will be preset to returned instance of Waitingpublic Wait timeout(long timeout)
timeout - in milliseconds that will be preset to returned instance of Waitingpublic Wait failWith(Exception exception)
Returns Waiting object initialized with given exception.
If the exception is instance of RuntimeException, it will be thrown in case of waiting timed out.
If the exception isn't instance of RuntimeException, the WaitingTimeoutException will be thrown with cause preset to the given Throwable.
If failure is set to null, timeout will not result to failure!
exception - the instance of RuntimeException to be thrown or any other Exception when the WaitTimeoutException
should be thrown with this exception as causepublic Wait failWith(CharSequence failureMessage, Object... arguments)
Returns preset instance of waiting with given failure message parametrized by given objects.
To parametrize failure message, the
org.jboss.arquillian.ajocado.format.SimplifiedFormat#format(String, Object...) will be used.
If failure is set to null, timeout will not result to failure!
failureMessage - character sequence that will be used as message of exception thrown in case of waiting timeout or
null if waiting timeout shouldn't result to failurearguments - arguments to failureMessage which will be use in parametrization of failureMessagepublic Wait dontFail()
public Wait noDelay()
public Wait withDelay(boolean isDelayed)
Set if testing condition should be delayed of one interval after the start of waiting.
The length of delay is one interval (see interval(long)).
isDelayed - true if start of condition testing should be delayed; false otherwisepublic void until(Condition condition)
condition - what wait for to be satisfiedprotected void fail()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.