public class TestReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private GeometryFactory |
geometryFactory |
private GeometryOperation |
geomOp |
(package private) java.util.Vector |
parsingProblems |
private ResultMatcher |
resultMatcher |
private static java.lang.String |
TAG_geometryOperation |
private static java.lang.String |
TAG_resultMatcher |
private double |
tolerance |
private WKTOrWKBReader |
wktorbReader |
Constructor and Description |
---|
TestReader() |
Modifier and Type | Method and Description |
---|---|
private java.io.File |
absoluteWktFile(java.io.File wktFile,
TestRun testRun) |
void |
clearParsingProblems() |
private PrecisionModel |
createPrecisionModel(org.jdom2.Element precisionModelElement) |
TestRun |
createTestRun(java.io.File testFile,
int runIndex) |
static java.util.List |
getContents(java.lang.String textFileName)
Returns a List of the String's in the text file, one per line.
|
GeometryOperation |
getGeometryOperation() |
private java.lang.Object |
getInstance(java.lang.String classname,
java.lang.Class baseClass)
Gets an instance of a class with the given name,
and ensures that the class is assignable to a specified baseClass.
|
java.util.List |
getParsingProblems() |
boolean |
isBooleanFunction(java.lang.String name) |
boolean |
isDoubleFunction(java.lang.String name) |
boolean |
isGeometryFunction(java.lang.String name) |
boolean |
isIntegerFunction(java.lang.String name) |
private GeometryOperation |
parseGeometryOperation(org.jdom2.Element runElement)
Parses an optional geometryOperation element.
|
private PrecisionModel |
parsePrecisionModel(org.jdom2.Element runElement)
Parses an optional precisionModel element.
|
private ResultMatcher |
parseResultMatcher(org.jdom2.Element runElement)
Parses an optional resultMatcher element.
|
private java.util.List |
parseTestCases(java.util.List caseElements,
java.io.File testFile,
TestRun testRun,
double tolerance)
Creates a List of TestCase's from the given
|
private TestRun |
parseTestRun(org.jdom2.Element runElement,
java.io.File testFile,
int runIndex)
Creates a TestRun from the
|
private java.util.List |
parseTests(java.util.List testElements,
int caseIndex,
java.io.File testFile,
TestCase testCase,
double tolerance)
Creates a List of Test's from the given
|
private double |
parseTolerance(org.jdom2.Element runElement) |
private Geometry |
readGeometry(org.jdom2.Element geometryElement,
java.io.File wktFile) |
private BooleanResult |
toBooleanResult(java.lang.String value) |
private DoubleResult |
toDoubleResult(java.lang.String value) |
private GeometryResult |
toGeometryResult(java.lang.String value,
TestRun testRun) |
private IntegerResult |
toIntegerResult(java.lang.String value) |
private Result |
toResult(java.lang.String value,
java.lang.String name,
TestRun testRun) |
private java.lang.String |
toString(java.util.List stringList) |
private java.io.File |
wktFile(org.jdom2.Element geometryElement,
TestRun testRun) |
private static final java.lang.String TAG_geometryOperation
private static final java.lang.String TAG_resultMatcher
java.util.Vector parsingProblems
private GeometryFactory geometryFactory
private WKTOrWKBReader wktorbReader
private double tolerance
private GeometryOperation geomOp
private ResultMatcher resultMatcher
public GeometryOperation getGeometryOperation()
public boolean isBooleanFunction(java.lang.String name)
public boolean isIntegerFunction(java.lang.String name)
public boolean isDoubleFunction(java.lang.String name)
public boolean isGeometryFunction(java.lang.String name)
public java.util.List getParsingProblems()
public void clearParsingProblems()
public TestRun createTestRun(java.io.File testFile, int runIndex)
private java.util.List parseTests(java.util.List testElements, int caseIndex, java.io.File testFile, TestCase testCase, double tolerance) throws TestParseException
TestParseException
private Result toResult(java.lang.String value, java.lang.String name, TestRun testRun) throws TestParseException, ParseException
TestParseException
ParseException
private BooleanResult toBooleanResult(java.lang.String value) throws TestParseException
TestParseException
private DoubleResult toDoubleResult(java.lang.String value) throws TestParseException
TestParseException
private IntegerResult toIntegerResult(java.lang.String value) throws TestParseException
TestParseException
private GeometryResult toGeometryResult(java.lang.String value, TestRun testRun) throws ParseException
ParseException
private java.util.List parseTestCases(java.util.List caseElements, java.io.File testFile, TestRun testRun, double tolerance) throws TestParseException
TestParseException
private TestRun parseTestRun(org.jdom2.Element runElement, java.io.File testFile, int runIndex) throws TestParseException
TestParseException
private PrecisionModel parsePrecisionModel(org.jdom2.Element runElement) throws TestParseException
runElement
- TestParseException
private PrecisionModel createPrecisionModel(org.jdom2.Element precisionModelElement) throws TestParseException
TestParseException
private GeometryOperation parseGeometryOperation(org.jdom2.Element runElement) throws TestParseException
runElement
- TestParseException
- if a parsing error was encounteredprivate ResultMatcher parseResultMatcher(org.jdom2.Element runElement) throws TestParseException
runElement
- TestParseException
- if a parsing error was encounteredprivate double parseTolerance(org.jdom2.Element runElement) throws TestParseException
TestParseException
private java.lang.Object getInstance(java.lang.String classname, java.lang.Class baseClass)
private java.io.File wktFile(org.jdom2.Element geometryElement, TestRun testRun) throws TestParseException
TestParseException
private Geometry readGeometry(org.jdom2.Element geometryElement, java.io.File wktFile) throws java.io.FileNotFoundException, ParseException, java.io.IOException
java.io.FileNotFoundException
ParseException
java.io.IOException
private java.lang.String toString(java.util.List stringList)
private java.io.File absoluteWktFile(java.io.File wktFile, TestRun testRun)
public static java.util.List getContents(java.lang.String textFileName) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException