- java.lang.Object
-
- com.iamsoft.util.ui.javafx.test.JavaFXJUnit5Test
-
public abstract class JavaFXJUnit5Test extends Object
Extend this class if all tests should be run on the JavaFX UI thread. If the JavaFX UI thread should be released for a while inside a test, thetestLater
andtestOnMainThreadLater
methods can be used to do this. Note that these methods queue the runnables in a single queue and then are served in FIFO order. After a runnable is queued, all code, which should be executed after the runnable, also should be queued. All queued runnables are execute one by one with the specified delay between them. Currently, there are two choices - to execute a runnable on the JavaFX thread, or on the main thread.
-
-
Constructor Summary
Constructors Constructor Description JavaFXJUnit5Test()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testLater(int pRetryCount, long pRetryDelayMillis, BooleanSupplier pSuccess)
This method can be used to wait for a condition to becometrue
by specifying a number of retries, before giving up, and a delay in milliseconds between retries.void
testLater(long pDelayMillis, Testable pRunnable)
Queues the specified runnable to be run on the JavaFX UI thread.void
testLater(Testable pRunnable)
Queues the specified runnable to be run on the JavaFX UI thread.void
testOnMainThreadLater(long pDelayMillis, Testable pRunnable)
Queues the specified runnable to be run on the main thread, instead of on the JavaFX UI thread.void
testOnMainThreadLater(Testable pRunnable)
Queues the specified runnable to be run on the main thread, instead of on the JavaFX UI thread.
-
-
-
Method Detail
-
testLater
public void testLater(Testable pRunnable)
Queues the specified runnable to be run on the JavaFX UI thread.
-
testLater
public void testLater(long pDelayMillis, Testable pRunnable)
Queues the specified runnable to be run on the JavaFX UI thread.
-
testLater
public void testLater(int pRetryCount, long pRetryDelayMillis, BooleanSupplier pSuccess)
This method can be used to wait for a condition to becometrue
by specifying a number of retries, before giving up, and a delay in milliseconds between retries. Note that the conditions is first evaluated without delay (after it pops from the queue), and after that the specified amount of retires is performed if needed.
-
testOnMainThreadLater
public void testOnMainThreadLater(Testable pRunnable)
Queues the specified runnable to be run on the main thread, instead of on the JavaFX UI thread.
-
testOnMainThreadLater
public void testOnMainThreadLater(long pDelayMillis, Testable pRunnable)
Queues the specified runnable to be run on the main thread, instead of on the JavaFX UI thread.
-
-