|
Graphene Implementation 1.0.0.CR3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.arquillian.ajocado.waiting.DefaultWaiting<T>
T
- the end implementation of DefaultWaiting as the return type for setter methodspublic abstract class DefaultWaiting<T extends Waiting<T>>
Abstract implementation of immutable class with purpose of waiting with customizable timeout, interval, and failure behaviour and delay on start of waiting.
Constructor Summary | |
---|---|
DefaultWaiting()
|
Method Summary | |
---|---|
T |
dontFail()
Sets no failure after waiting timeout. |
protected void |
fail()
Tries to fail by throwing 'failure' throwable. |
T |
failWith(CharSequence failureMessage,
Object... arguments)
Returns preset instance of waiting with given failure message parametrized by given objects. |
T |
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. |
T |
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. |
T |
noDelay()
Sets no delay between start of waiting and first test for conditions. |
T |
timeout(long timeout)
Returns instance of waiting with same properties like this object and timeout set to given timeout. |
void |
waitForTimeout()
Waits for predefined amount of time (see Waiting.timeout(long) ). |
T |
withDelay(boolean isDelayed)
Set if testing condition should be delayed of one interval after the start of waiting. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultWaiting()
Method Detail |
---|
protected long getInterval()
protected long getTimeout()
protected boolean isDelayed()
public T interval(long interval)
Waiting
interval
in interface Waiting<T extends Waiting<T>>
interval
- in milliseconds that will be preset to returned instance of Waiting
public T timeout(long timeout)
Waiting
timeout
in interface Waiting<T extends Waiting<T>>
timeout
- in milliseconds that will be preset to returned instance of Waiting
public T failWith(Exception exception)
Waiting
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!
failWith
in interface Waiting<T extends Waiting<T>>
exception
- the instance of RuntimeException to be thrown or any other Exception when the WaitTimeoutException
should be thrown with this exception as cause
public T failWith(CharSequence failureMessage, Object... arguments)
Waiting
Returns preset instance of waiting with given failure message parametrized by given objects.
To parametrize failure message, the
SimplifiedFormat.format(String, Object...)
will be used.
If failure is set to null, timeout will not result to failure!
failWith
in interface Waiting<T extends Waiting<T>>
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 failureMessage
public T dontFail()
Waiting
dontFail
in interface Waiting<T extends Waiting<T>>
public T noDelay()
Waiting
noDelay
in interface Waiting<T extends Waiting<T>>
public T withDelay(boolean isDelayed)
Waiting
Set if testing condition should be delayed of one interval after the start of waiting.
The length of delay is one interval (see Waiting.interval(long)
).
withDelay
in interface Waiting<T extends Waiting<T>>
isDelayed
- true if start of condition testing should be delayed; false otherwise
public void waitForTimeout()
Waiting
Waiting.timeout(long)
).
waitForTimeout
in interface Waiting<T extends Waiting<T>>
protected void fail()
|
Graphene Implementation 1.0.0.CR3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |