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

Classes

enum  Section
 
class  TestCase
 

Public Member Functions

 TestFileParser (String fileName)
 
List< TestCasegetTestCases ()
 
String getTestFileName ()
 
boolean hasSetupSection ()
 
void parseFile ()
 
void parseFile (String table)
 

Private Member Functions

void open (String table)
 
TestCase parseOneTestCase ()
 
void close ()
 

Private Attributes

final List< TestCasetestCases = Lists.newArrayList()
 
int lineNum = 0
 
final String fileName
 
BufferedReader reader
 
Scanner scanner
 
boolean hasSetupSection = false
 

Static Private Attributes

static final Logger LOG = Logger.getLogger(TestCase.class)
 
static final ArrayList< SectiondefaultSectionOrder
 

Detailed Description

Parses a file containing one or more test case descriptions into a list of TestCase objects. A test file has the following format:

<QUERY string>=""> -— <SECTION NAME 1> <EXPECTED CONTENTS 1> -— <SECTION NAME 2> <EXPECTED CONTENTS 2> -— <SECTION NAME 3>

<EXPECTED CONTENTS 3>

<QUERY string>=""> -— <SECTION NAME 1> <EXPECTED CONTENTS 1> -— <SECTION NAME 2> <EXPECTED CONTENTS 2> -— <SECTION NAME 3>

<EXPECTED CONTENTS 3>

Acceptable section names are ONLY those contained in TestFileParser.Section.

Lines beginning with # or // are comments. Clients can retrieve sections with or without these lines included.

Note that <QUERY string>=""> and <EXPECTED contents>=""> sections can consist of multiple lines.

Definition at line 51 of file TestFileParser.java.

Constructor & Destructor Documentation

com.cloudera.impala.testutil.TestFileParser.TestFileParser ( String  fileName)
inline

Member Function Documentation

void com.cloudera.impala.testutil.TestFileParser.close ( )
inlineprivate
List<TestCase> com.cloudera.impala.testutil.TestFileParser.getTestCases ( )
inline
String com.cloudera.impala.testutil.TestFileParser.getTestFileName ( )
inline
boolean com.cloudera.impala.testutil.TestFileParser.hasSetupSection ( )
inline
void com.cloudera.impala.testutil.TestFileParser.open ( String  table)
inlineprivate
void com.cloudera.impala.testutil.TestFileParser.parseFile ( )
inline

Parses a test file in its entirety and constructs a list of TestCases.

Definition at line 302 of file TestFileParser.java.

Member Data Documentation

final ArrayList<Section> com.cloudera.impala.testutil.TestFileParser.defaultSectionOrder
staticprivate
Initial value:

For backwards compatibility, if no title is found this is the order in which sections are labeled.

Definition at line 198 of file TestFileParser.java.

Referenced by com.cloudera.impala.testutil.TestFileParser.parseOneTestCase().

final String com.cloudera.impala.testutil.TestFileParser.fileName
private
boolean com.cloudera.impala.testutil.TestFileParser.hasSetupSection = false
private

Definition at line 192 of file TestFileParser.java.

int com.cloudera.impala.testutil.TestFileParser.lineNum = 0
private
final Logger com.cloudera.impala.testutil.TestFileParser.LOG = Logger.getLogger(TestCase.class)
staticprivate

Definition at line 52 of file TestFileParser.java.

BufferedReader com.cloudera.impala.testutil.TestFileParser.reader
private
final List<TestCase> com.cloudera.impala.testutil.TestFileParser.testCases = Lists.newArrayList()
private

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