Class TestReader
java.lang.Object
org.locationtech.jtstest.testrunner.TestReader
- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GeometryFactoryprivate GeometryOperation(package private) Vectorprivate ResultMatcherprivate static final Stringprivate static final Stringprivate doubleprivate WKTOrWKBReader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate FileabsoluteWktFile(File wktFile, TestRun testRun) voidprivate PrecisionModelcreatePrecisionModel(org.jdom2.Element precisionModelElement) createTestRun(File testFile, int runIndex) static ListgetContents(String textFileName) Returns a List of the String's in the text file, one per line.private ObjectgetInstance(String classname, Class baseClass) Gets an instance of a class with the given name, and ensures that the class is assignable to a specified baseClass.booleanisBooleanFunction(String name) booleanisDoubleFunction(String name) booleanisGeometryFunction(String name) booleanisIntegerFunction(String name) private GeometryOperationparseGeometryOperation(org.jdom2.Element runElement) Parses an optional geometryOperation element.private PrecisionModelparsePrecisionModel(org.jdom2.Element runElement) Parses an optional precisionModel element.private ResultMatcherparseResultMatcher(org.jdom2.Element runElement) Parses an optional resultMatcher element.private ListparseTestCases(List caseElements, File testFile, TestRun testRun, double tolerance) Creates a List of TestCase's from the givenElement's. private TestRunparseTestRun(org.jdom2.Element runElement, File testFile, int runIndex) Creates a TestRun from theElement. private ListparseTests(List testElements, int caseIndex, File testFile, TestCase testCase, double tolerance) Creates a List of Test's from the givenElement's. private doubleparseTolerance(org.jdom2.Element runElement) private GeometryreadGeometry(org.jdom2.Element geometryElement, File wktFile) private BooleanResulttoBooleanResult(String value) private DoubleResulttoDoubleResult(String value) private GeometryResulttoGeometryResult(String value, TestRun testRun) private IntegerResulttoIntegerResult(String value) private Resultprivate Stringprivate File
-
Field Details
-
TAG_geometryOperation
- See Also:
-
TAG_resultMatcher
- See Also:
-
parsingProblems
Vector parsingProblems -
geometryFactory
-
wktorbReader
-
tolerance
private double tolerance -
geomOp
-
resultMatcher
-
-
Constructor Details
-
TestReader
public TestReader()
-
-
Method Details
-
getGeometryOperation
-
isBooleanFunction
-
isIntegerFunction
-
isDoubleFunction
-
isGeometryFunction
-
getParsingProblems
-
clearParsingProblems
public void clearParsingProblems() -
createTestRun
-
parseTests
private List parseTests(List testElements, int caseIndex, File testFile, TestCase testCase, double tolerance) throws TestParseException Creates a List of Test's from the givenElement's. - Throws:
TestParseException
-
toResult
private Result toResult(String value, String name, TestRun testRun) throws TestParseException, ParseException - Throws:
TestParseExceptionParseException
-
toBooleanResult
- Throws:
TestParseException
-
toDoubleResult
- Throws:
TestParseException
-
toIntegerResult
- Throws:
TestParseException
-
toGeometryResult
- Throws:
ParseException
-
parseTestCases
private List parseTestCases(List caseElements, File testFile, TestRun testRun, double tolerance) throws TestParseException Creates a List of TestCase's from the givenElement's. - Throws:
TestParseException
-
parseTestRun
private TestRun parseTestRun(org.jdom2.Element runElement, File testFile, int runIndex) throws TestParseException Creates a TestRun from theElement. - Throws:
TestParseException
-
parsePrecisionModel
Parses an optional precisionModel element. The default is to use a FLOATING model.- Parameters:
runElement-- Returns:
- a PrecisionModel instance (default if not specified)
- Throws:
TestParseException
-
createPrecisionModel
private PrecisionModel createPrecisionModel(org.jdom2.Element precisionModelElement) throws TestParseException - Throws:
TestParseException
-
parseGeometryOperation
private GeometryOperation parseGeometryOperation(org.jdom2.Element runElement) throws TestParseException Parses an optional geometryOperation element. The default is to leave this unspecified .- Parameters:
runElement-- Returns:
- an instance of the GeometryOperation class, if specified, or null if no geometry operation was specified
- Throws:
TestParseException- if a parsing error was encountered
-
parseResultMatcher
Parses an optional resultMatcher element. The default is to leave this unspecified .- Parameters:
runElement-- Returns:
- an instance of the ResultMatcher class, if specified, or null if no result matcher was specified
- Throws:
TestParseException- if a parsing error was encountered
-
parseTolerance
- Throws:
TestParseException
-
getInstance
Gets an instance of a class with the given name, and ensures that the class is assignable to a specified baseClass.- Returns:
- an instance of the class, if it is assignment-compatible, or null if the requested class is not assigment-compatible
-
wktFile
- Throws:
TestParseException
-
readGeometry
private Geometry readGeometry(org.jdom2.Element geometryElement, File wktFile) throws FileNotFoundException, ParseException, IOException -
toString
-
absoluteWktFile
-
getContents
Returns a List of the String's in the text file, one per line.- Throws:
FileNotFoundExceptionIOException
-