public class TestBaseUtils
extends org.apache.flink.util.TestLogger
| Modifier and Type | Class and Description |
|---|---|
static class |
TestBaseUtils.TupleComparator<T extends org.apache.flink.api.java.tuple.Tuple> |
| Modifier and Type | Field and Description |
|---|---|
protected static long |
DEFAULT_AKKA_ASK_TIMEOUT |
protected static String |
DEFAULT_AKKA_STARTUP_TIMEOUT |
static scala.concurrent.duration.FiniteDuration |
DEFAULT_TIMEOUT |
protected static File |
logDir |
protected static int |
MINIMUM_HEAP_SIZE_MB |
protected static long |
TASK_MANAGER_MEMORY_SIZE |
| Modifier | Constructor and Description |
|---|---|
protected |
TestBaseUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected static File |
asFile(String path) |
static void |
checkLinesAgainstRegexp(String resultPath,
String regexp) |
static void |
compareKeyValuePairsWithDelta(String expectedLines,
String resultPath,
String[] excludePrefixes,
String delimiter,
double maxDelta) |
static void |
compareKeyValuePairsWithDelta(String expectedLines,
String resultPath,
String delimiter,
double maxDelta) |
static <T> void |
compareOrderedResultAsText(List<T> result,
String expected) |
static <T> void |
compareOrderedResultAsText(List<T> result,
String expected,
boolean asTuples) |
static <T> void |
compareResultAsText(List<T> result,
String expected) |
static <T> void |
compareResultAsTuples(List<T> result,
String expected) |
static <X> void |
compareResultCollections(List<X> expected,
List<X> actual,
Comparator<X> comparator) |
static void |
compareResultsByLinesInMemory(String expectedResultStr,
String resultPath) |
static void |
compareResultsByLinesInMemory(String expectedResultStr,
String resultPath,
String[] excludePrefixes) |
static void |
compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr,
String resultPath) |
static void |
compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr,
String resultPath,
String[] excludePrefixes) |
static String |
constructTestPath(Class<?> forClass,
String folder) |
static String |
constructTestURI(Class<?> forClass,
String folder) |
static <T> void |
containsResultAsText(List<T> result,
String expected)
The expected string contains all expected results separate with line break, check whether all elements in result
are contained in the expected string.
|
protected static void |
deleteRecursively(File f) |
static String |
getFromHTTP(String url) |
static BufferedInputStream[] |
getResultInputStream(String resultPath) |
static BufferedInputStream[] |
getResultInputStream(String resultPath,
String[] excludePrefixes) |
static BufferedReader[] |
getResultReader(String resultPath) |
static BufferedReader[] |
getResultReader(String resultPath,
String[] excludePrefixes,
boolean inOrderOfFiles) |
static void |
readAllResultLines(List<String> target,
String resultPath) |
static void |
readAllResultLines(List<String> target,
String resultPath,
String[] excludePrefixes) |
static void |
readAllResultLines(List<String> target,
String resultPath,
String[] excludePrefixes,
boolean inOrderOfFiles) |
static void |
setEnv(Map<String,String> newenv) |
static org.apache.flink.test.util.ForkableFlinkMiniCluster |
startCluster(org.apache.flink.configuration.Configuration config,
boolean singleActorSystem) |
static org.apache.flink.test.util.ForkableFlinkMiniCluster |
startCluster(int numTaskManagers,
int taskManagerNumSlots,
boolean startWebserver,
boolean startZooKeeper,
boolean singleActorSystem) |
static void |
stopCluster(org.apache.flink.test.util.ForkableFlinkMiniCluster executor,
scala.concurrent.duration.FiniteDuration timeout) |
protected static Collection<Object[]> |
toParameterList(org.apache.flink.configuration.Configuration... testConfigs) |
protected static Collection<Object[]> |
toParameterList(List<org.apache.flink.configuration.Configuration> testConfigs) |
protected static final int MINIMUM_HEAP_SIZE_MB
protected static final long TASK_MANAGER_MEMORY_SIZE
protected static final long DEFAULT_AKKA_ASK_TIMEOUT
protected static final String DEFAULT_AKKA_STARTUP_TIMEOUT
public static scala.concurrent.duration.FiniteDuration DEFAULT_TIMEOUT
protected static File logDir
public static org.apache.flink.test.util.ForkableFlinkMiniCluster startCluster(int numTaskManagers,
int taskManagerNumSlots,
boolean startWebserver,
boolean startZooKeeper,
boolean singleActorSystem)
throws Exception
Exceptionpublic static org.apache.flink.test.util.ForkableFlinkMiniCluster startCluster(org.apache.flink.configuration.Configuration config,
boolean singleActorSystem)
throws Exception
Exceptionpublic static void stopCluster(org.apache.flink.test.util.ForkableFlinkMiniCluster executor,
scala.concurrent.duration.FiniteDuration timeout)
throws Exception
Exceptionpublic static BufferedReader[] getResultReader(String resultPath) throws IOException
IOExceptionpublic static BufferedReader[] getResultReader(String resultPath, String[] excludePrefixes, boolean inOrderOfFiles) throws IOException
IOExceptionpublic static BufferedInputStream[] getResultInputStream(String resultPath) throws IOException
IOExceptionpublic static BufferedInputStream[] getResultInputStream(String resultPath, String[] excludePrefixes) throws IOException
IOExceptionpublic static void readAllResultLines(List<String> target, String resultPath) throws IOException
IOExceptionpublic static void readAllResultLines(List<String> target, String resultPath, String[] excludePrefixes) throws IOException
IOExceptionpublic static void readAllResultLines(List<String> target, String resultPath, String[] excludePrefixes, boolean inOrderOfFiles) throws IOException
IOExceptionpublic static void compareResultsByLinesInMemory(String expectedResultStr, String resultPath) throws Exception
Exceptionpublic static void compareResultsByLinesInMemory(String expectedResultStr, String resultPath, String[] excludePrefixes) throws Exception
Exceptionpublic static void compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr, String resultPath) throws Exception
Exceptionpublic static void compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr, String resultPath, String[] excludePrefixes) throws Exception
Exceptionpublic static void checkLinesAgainstRegexp(String resultPath, String regexp)
public static void compareKeyValuePairsWithDelta(String expectedLines, String resultPath, String delimiter, double maxDelta) throws Exception
Exceptionpublic static void compareKeyValuePairsWithDelta(String expectedLines, String resultPath, String[] excludePrefixes, String delimiter, double maxDelta) throws Exception
Exceptionpublic static <X> void compareResultCollections(List<X> expected, List<X> actual, Comparator<X> comparator)
public static <T> void compareOrderedResultAsText(List<T> result, String expected)
public static <T> void compareOrderedResultAsText(List<T> result, String expected, boolean asTuples)
public static <T> void containsResultAsText(List<T> result, String expected)
T - The result type.result - The test result.expected - The expected string value combination.protected static Collection<Object[]> toParameterList(org.apache.flink.configuration.Configuration... testConfigs)
protected static Collection<Object[]> toParameterList(List<org.apache.flink.configuration.Configuration> testConfigs)
protected static void deleteRecursively(File f) throws IOException
IOExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.