Class TestCaseUtils
- java.lang.Object
-
- org.apache.flink.cdc.common.utils.TestCaseUtils
-
public class TestCaseUtils extends Object
Some utility methods for creating repeated-checking test cases.
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.DurationDEFAULT_INTERVALstatic java.time.DurationDEFAULT_TIMEOUT
-
Constructor Summary
Constructors Constructor Description TestCaseUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidrepeatedCheck(java.util.function.Supplier<Boolean> fetcher)Fetch with a (timeout,interval) duration.static voidrepeatedCheck(java.util.function.Supplier<Boolean> fetcher, java.time.Duration timeout)Fetch with a (timeout,interval) duration.static voidrepeatedCheck(java.util.function.Supplier<Boolean> fetcher, java.time.Duration timeout, java.time.Duration interval)Fetch with a (timeout,interval) duration.static <T> voidrepeatedCheck(java.util.function.Supplier<T> fetcher, java.util.function.Predicate<T> validator, java.time.Duration timeout, java.time.Duration interval)Fetch and wait with a (timeout,interval) duration.static voidrepeatedCheck(org.apache.flink.util.function.SupplierWithException<Boolean,Throwable> fetcher, java.time.Duration timeout, java.time.Duration interval, List<Class<? extends Throwable>> allowedThrowsList)Waiting for fetching values with a (timeout,interval) duration.static <T> voidrepeatedCheckAndValidate(org.apache.flink.util.function.SupplierWithException<T,Throwable> fetcher, java.util.function.Predicate<T> validator, java.time.Duration timeout, java.time.Duration interval, List<Class<? extends Throwable>> allowedThrowsList)Fetch and validate, with a (timeout,interval) duration.
-
-
-
Method Detail
-
repeatedCheck
public static void repeatedCheck(java.util.function.Supplier<Boolean> fetcher)
Fetch with a (timeout,interval) duration.
-
repeatedCheck
public static void repeatedCheck(java.util.function.Supplier<Boolean> fetcher, java.time.Duration timeout)
Fetch with a (timeout,interval) duration.
-
repeatedCheck
public static void repeatedCheck(java.util.function.Supplier<Boolean> fetcher, java.time.Duration timeout, java.time.Duration interval)
Fetch with a (timeout,interval) duration.
-
repeatedCheck
public static <T> void repeatedCheck(java.util.function.Supplier<T> fetcher, java.util.function.Predicate<T> validator, java.time.Duration timeout, java.time.Duration interval)Fetch and wait with a (timeout,interval) duration.
-
repeatedCheck
public static void repeatedCheck(org.apache.flink.util.function.SupplierWithException<Boolean,Throwable> fetcher, java.time.Duration timeout, java.time.Duration interval, List<Class<? extends Throwable>> allowedThrowsList)
Waiting for fetching values with a (timeout,interval) duration.
-
repeatedCheckAndValidate
public static <T> void repeatedCheckAndValidate(org.apache.flink.util.function.SupplierWithException<T,Throwable> fetcher, java.util.function.Predicate<T> validator, java.time.Duration timeout, java.time.Duration interval, List<Class<? extends Throwable>> allowedThrowsList)
Fetch and validate, with a (timeout,interval) duration.
-
-