Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.testutil.TestUtils Class Reference
Collaboration diagram for com.cloudera.impala.testutil.TestUtils:

Static Public Member Functions

static String compareOutput (ArrayList< String > actual, ArrayList< String > expected, boolean orderMatters)
 
static TQueryCtx createQueryContext ()
 
static TQueryCtx createQueryContext (String defaultDb, String user)
 
static String prettyPrintJson (String json)
 

Static Private Member Functions

static String applyHdfsFilePathFilter (String hdfsPath)
 

Static Private Attributes

static final Logger LOG = LoggerFactory.getLogger(TestUtils.class)
 
static final String[] expectedFilePrefix_ = { "hdfs:", "file: " }
 
static final String[] ignoreContentAfter_ = { "HOST:", "LOCATIONS:" }
 
static final String regexAgainstActual_ = "regex:"
 
static final String HDFS_FILE_PATH_FILTER = "-*\\d+--\\d+_\\d+.*$"
 
static final String HDFS_HOST_PORT_FILTER = "//\\w+:\\d+/"
 

Detailed Description

Definition at line 34 of file TestUtils.java.

Member Function Documentation

static String com.cloudera.impala.testutil.TestUtils.applyHdfsFilePathFilter ( String  hdfsPath)
inlinestaticprivate

Applied a filter on the HDFS path to strip out information that might vary from run to run.

Definition at line 188 of file TestUtils.java.

References com.cloudera.impala.testutil.TestUtils.HDFS_FILE_PATH_FILTER, and com.cloudera.impala.testutil.TestUtils.HDFS_HOST_PORT_FILTER.

Referenced by com.cloudera.impala.testutil.TestUtils.compareOutput().

static String com.cloudera.impala.testutil.TestUtils.compareOutput ( ArrayList< String >  actual,
ArrayList< String >  expected,
boolean  orderMatters 
)
inlinestatic

Do a line-by-line comparison of actual and expected output. Comparison of the individual lines ignores whitespace. If an expected line starts with expectedFilePrefix, then the expected vs. actual comparison is successful if the actual string contains the expected line (ignoring the expectedFilePrefix prefix). If orderMatters is false, we consider actual to match expected if they both contains the same output lines regardless of order.

Returns
an error message if actual does not match expected, "" otherwise.

Definition at line 61 of file TestUtils.java.

References com.cloudera.impala.testutil.TestUtils.applyHdfsFilePathFilter(), com.cloudera.impala.testutil.TestUtils.expectedFilePrefix_, com.cloudera.impala.testutil.TestUtils.ignoreContentAfter_, and com.cloudera.impala.testutil.TestUtils.regexAgainstActual_.

static TQueryCtx com.cloudera.impala.testutil.TestUtils.createQueryContext ( String  defaultDb,
String  user 
)
inlinestatic

Create a TQueryCtx for executing FE tests using the given default DB and user.

Definition at line 204 of file TestUtils.java.

static String com.cloudera.impala.testutil.TestUtils.prettyPrintJson ( String  json)
inlinestatic

Pretty print a JSON string.

Definition at line 219 of file TestUtils.java.

Member Data Documentation

final String [] com.cloudera.impala.testutil.TestUtils.expectedFilePrefix_ = { "hdfs:", "file: " }
staticprivate

Definition at line 36 of file TestUtils.java.

Referenced by com.cloudera.impala.testutil.TestUtils.compareOutput().

final String com.cloudera.impala.testutil.TestUtils.HDFS_FILE_PATH_FILTER = "-*\\d+--\\d+_\\d+.*$"
staticprivate
final String com.cloudera.impala.testutil.TestUtils.HDFS_HOST_PORT_FILTER = "//\\w+:\\d+/"
staticprivate
final String [] com.cloudera.impala.testutil.TestUtils.ignoreContentAfter_ = { "HOST:", "LOCATIONS:" }
staticprivate

Definition at line 37 of file TestUtils.java.

Referenced by com.cloudera.impala.testutil.TestUtils.compareOutput().

final Logger com.cloudera.impala.testutil.TestUtils.LOG = LoggerFactory.getLogger(TestUtils.class)
staticprivate

Definition at line 35 of file TestUtils.java.

final String com.cloudera.impala.testutil.TestUtils.regexAgainstActual_ = "regex:"
staticprivate

Definition at line 40 of file TestUtils.java.

Referenced by com.cloudera.impala.testutil.TestUtils.compareOutput().


The documentation for this class was generated from the following file: