Class WaitForExecutable
java.lang.Object
org.glassfish.tests.utils.junit.matcher.WaitForExecutable
- All Implemented Interfaces:
org.junit.jupiter.api.function.Executable
Repeats the executable action and catches the
AssertionError until the test passes or times out.
Note: Dont't confuse with AssertTimeout
- Author:
- David Matejcek
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()static voidwaitFor(org.junit.jupiter.api.function.Executable executable, long timeoutInMillis) Creates and runs new executable waiting to pass given executable.static WaitForExecutablewaitUntilPassed(org.junit.jupiter.api.function.Executable executable, long timeoutInMillis) Creates a new executable waiting to pass given executable.
-
Method Details
-
waitFor
public static void waitFor(org.junit.jupiter.api.function.Executable executable, long timeoutInMillis) throws Throwable Creates and runs new executable waiting to pass given executable.- Parameters:
executable- executable that has to end without errors to pass the testtimeoutInMillis- timeout to pass- Throws:
Throwable- thrown after timeout, not sooner
-
waitUntilPassed
public static WaitForExecutable waitUntilPassed(org.junit.jupiter.api.function.Executable executable, long timeoutInMillis) Creates a new executable waiting to pass given executable. Don't forget to execute inAssertions.assertAll(Executable...)or similar method..- Parameters:
executable- executable that has to end without errors to pass the testtimeoutInMillis- timeout to pass- Returns:
- new instance of
WaitForExecutable
-
execute
- Specified by:
executein interfaceorg.junit.jupiter.api.function.Executable- Throws:
Throwable
-