public abstract class AbstractParserTest extends AbstractModuleTest
COLON, EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SEMICOLON, SLASH, SPACE, STAR
Constructor and Description |
---|
AbstractParserTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertAttributeEquals(SinkEventElement element,
String name,
String attr,
String value) |
protected void |
assertEquals(Iterator<SinkEventElement> it,
String... names) |
protected void |
assertEquals(SinkEventElement element,
String name,
Object... args) |
protected abstract Parser |
createParser()
Create a new instance of the parser to test.
|
protected String |
getOutputDir()
Returns the directory where all parser test output will go.
|
void |
testDocument()
Parse a test document '"test." + outputExtension()'
with parser from
createParser() , and output to a text file,
using the TextSink . |
void |
testParser()
Parse a test document '"test." + outputExtension()'
with parser from
createParser() , and output to a new
WellformednessCheckingSink . |
getBasedirFile, getTestReader, getTestReader, getTestWriter, getTestWriter, getTestWriterFile, getTestWriterFile, getXmlTestWriter, getXmlTestWriter, outputBaseDir, outputExtension
customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, setUp, tearDown
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
public AbstractParserTest()
protected abstract Parser createParser()
protected String getOutputDir()
getOutputDir
in class AbstractModuleTest
public final void testParser() throws IOException, ParseException
createParser()
, and output to a new
WellformednessCheckingSink
. Asserts that output is well-formed.IOException
- if the test document cannot be read.ParseException
- if the test document cannot be parsed.public final void testDocument() throws IOException, ParseException
createParser()
, and output to a text file,
using the TextSink
.IOException
- if the test document cannot be read.ParseException
- if the test document cannot be parsed.protected void assertEquals(SinkEventElement element, String name, Object... args)
protected void assertAttributeEquals(SinkEventElement element, String name, String attr, String value)
protected void assertEquals(Iterator<SinkEventElement> it, String... names)
Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.