public class RaceTestUtils extends Object
| Constructor and Description |
|---|
RaceTestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
race(Runnable r1,
Runnable r2)
Synchronizes the execution of two
Runnable as much as possible
to test race conditions. |
static void |
race(Runnable r1,
Runnable r2,
reactor.core.scheduler.Scheduler s)
Synchronizes the execution of two
Runnable as much as possible
to test race conditions. |
static <T> boolean |
race(T initial,
Function<? super T,? extends T> race,
Predicate<? super T> stopRace,
BiPredicate<? super T,? super T> terminate)
Synchronizes the execution of two concurrent state modifications as much as
possible to test race conditions.
|
public static <T> boolean race(T initial,
Function<? super T,? extends T> race,
Predicate<? super T> stopRace,
BiPredicate<? super T,? super T> terminate)
Predicate
matches. It performs a BiPredicate test at the end to validate the end
result.initial - the initial staterace - the state-modification FunctionstopRace - the stop condition for the race loop, as a Predicateterminate - the validation check, as a BiPredicateterminate checkpublic static void race(Runnable r1, Runnable r2)
Runnable as much as possible
to test race conditions. The method blocks until both have run to completion.r1 - the first runnabler2 - the second runnablepublic static void race(Runnable r1, Runnable r2, reactor.core.scheduler.Scheduler s)
Runnable as much as possible
to test race conditions. The method blocks until both have run to completion.r1 - the first runnabler2 - the second runnables - the Scheduler on which to execute the runnables