@Component(value="tapirWaitExtensions") public class WaitExtensions extends Object
Constructor and Description |
---|
WaitExtensions() |
Modifier and Type | Method and Description |
---|---|
protected long |
calculateWaitTime(long timeout)
Calculates the wait time between two attempts.
|
boolean |
waitForCondition(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> condition)
Calls
#waitForCondition(Function0, long) with the configured implicit wait time. |
boolean |
waitForCondition(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> condition,
long timeout)
Waits for the condition becoming true.
|
<T> T |
waitForNoException(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable)
Calls
#waitForNoThrowableOfType(Class, Function0) with Exception as throwableType parameter. |
<T> T |
waitForNoException(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable,
long timeout)
Calls
#waitForNoThrowableOfType(Class, Function0, long) with Exception as throwableType parameter. |
<T> T |
waitForNoThrowableOfType(Class<? extends Throwable> throwableType,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable)
Calls
#waitForNoThrowableOfType(Class, Function0, long) with the configured implicit wait time. |
<T> T |
waitForNoThrowableOfType(Class<? extends Throwable> throwableType,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable,
long timeout)
Waits for the lambda expression throwing no longer an
Throwable which is assignable-compatible with the given
throwableType. |
<T> T |
waitForNotNull(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable)
Calls
#waitForNotNull(Function0, long) with the configured implicit wait time. |
<T> T |
waitForNotNull(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable,
long timeout)
Waits for the lambda expression returning something else than null.
|
public boolean waitForCondition(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> condition)
#waitForCondition(Function0, long)
with the configured implicit wait time. The condition is evaluated at least once.condition
- The condition to wait for.public <T> T waitForNotNull(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable)
#waitForNotNull(Function0, long)
with the configured implicit wait time. The executable is executed at least once.T
- return type of the given executableexecutable
- The lambda expression to wait for.public <T> T waitForNoException(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable)
#waitForNoThrowableOfType(Class, Function0)
with Exception
as throwableType parameter. The executable
is executed at least once.T
- return type of the given executableexecutable
- The lambda expression to wait for.public <T> T waitForNoThrowableOfType(Class<? extends Throwable> throwableType, org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable)
#waitForNoThrowableOfType(Class, Function0, long)
with the configured implicit wait time. The executable is
executed at least once.T
- return type of the given executablethrowableType
- The throwable type (including subtypes) which should be handled.executable
- The lambda expression to wait for.public boolean waitForCondition(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> condition, long timeout)
condition
- The condition to wait for.timeout
- The timeout in milliseconds after which the method returns false.public <T> T waitForNotNull(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable, long timeout)
T
- return type of the given executableexecutable
- The lambda expression to wait for.timeout
- The timeout in milliseconds after which the method returns null.public <T> T waitForNoException(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable, long timeout)
#waitForNoThrowableOfType(Class, Function0, long)
with Exception
as throwableType parameter. The
executable is executed at least once.T
- return type of the given executableexecutable
- The lambda expression to wait for.timeout
- The timeout in milliseconds after which the method returns null or throws the last exception.public <T> T waitForNoThrowableOfType(Class<? extends Throwable> throwableType, org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> executable, long timeout)
Throwable
which is assignable-compatible with the given
throwableType. The default implementation waits a quarter of the timeout between each attempt. The executable is executed at
least once.T
- return type of the given executablethrowableType
- The throwable type (including subtypes) which should be handled.executable
- The lambda expression to wait for.timeout
- The timeout in milliseconds after which the method returns null or throws the last Throwable
.Throwable
is thrown.protected long calculateWaitTime(long timeout)
timeout
- The timeout in milliseconds.Copyright © 2018–2021 b+m Informatik AG. All rights reserved.