public class TestBaseUtils extends TestLogger
Modifier and Type | Class and Description |
---|---|
static class |
TestBaseUtils.TupleComparator<T extends 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 |
log, watchman
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 ForkableFlinkMiniCluster |
startCluster(Configuration config,
boolean singleActorSystem) |
static ForkableFlinkMiniCluster |
startCluster(int numTaskManagers,
int taskManagerNumSlots,
boolean startWebserver,
boolean startZooKeeper,
boolean singleActorSystem) |
static void |
stopCluster(ForkableFlinkMiniCluster executor,
scala.concurrent.duration.FiniteDuration timeout) |
protected static Collection<Object[]> |
toParameterList(Configuration... testConfigs) |
protected static Collection<Object[]> |
toParameterList(List<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 ForkableFlinkMiniCluster startCluster(int numTaskManagers, int taskManagerNumSlots, boolean startWebserver, boolean startZooKeeper, boolean singleActorSystem) throws Exception
Exception
public static ForkableFlinkMiniCluster startCluster(Configuration config, boolean singleActorSystem) throws Exception
Exception
public static void stopCluster(ForkableFlinkMiniCluster executor, scala.concurrent.duration.FiniteDuration timeout) throws Exception
Exception
public static BufferedReader[] getResultReader(String resultPath) throws IOException
IOException
public static BufferedReader[] getResultReader(String resultPath, String[] excludePrefixes, boolean inOrderOfFiles) throws IOException
IOException
public static BufferedInputStream[] getResultInputStream(String resultPath) throws IOException
IOException
public static BufferedInputStream[] getResultInputStream(String resultPath, String[] excludePrefixes) throws IOException
IOException
public static void readAllResultLines(List<String> target, String resultPath) throws IOException
IOException
public static void readAllResultLines(List<String> target, String resultPath, String[] excludePrefixes) throws IOException
IOException
public static void readAllResultLines(List<String> target, String resultPath, String[] excludePrefixes, boolean inOrderOfFiles) throws IOException
IOException
public static void compareResultsByLinesInMemory(String expectedResultStr, String resultPath) throws Exception
Exception
public static void compareResultsByLinesInMemory(String expectedResultStr, String resultPath, String[] excludePrefixes) throws Exception
Exception
public static void compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr, String resultPath) throws Exception
Exception
public static void compareResultsByLinesInMemoryWithStrictOrder(String expectedResultStr, String resultPath, String[] excludePrefixes) throws Exception
Exception
public static void checkLinesAgainstRegexp(String resultPath, String regexp)
public static void compareKeyValuePairsWithDelta(String expectedLines, String resultPath, String delimiter, double maxDelta) throws Exception
Exception
public static void compareKeyValuePairsWithDelta(String expectedLines, String resultPath, String[] excludePrefixes, String delimiter, double maxDelta) throws Exception
Exception
public 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(Configuration... testConfigs)
protected static Collection<Object[]> toParameterList(List<Configuration> testConfigs)
protected static void deleteRecursively(File f) throws IOException
IOException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.