Class JTSTestRunnerCmd
- java.lang.Object
-
- org.locationtech.jtstest.testrunner.JTSTestRunnerCmd
-
public class JTSTestRunnerCmd extends java.lang.ObjectA command-line utility to execute tests specified in JTS Test XML files. Displays status and any errors encountered.Command Line Options
-files { <fileOrDirectoryName> } req Specifies the XML test files to run -geomop <classname> opt Specifies a custom GeometryOperationto be used-testCaseIndex <num> opt Specifies the index of a single test to run -verbose opt Provides verbose output - Version:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJTSTestRunnerCmd.TestRunnerOptions
-
Field Summary
Fields Modifier and Type Field Description private static GeometryOperationdefaultOpprivate static ResultMatcherdefaultResultMatcherprivate TestEngineengineprivate static GeometryFunctionRegistryfuncRegistryprivate static GeometryOperationgeometryOpprivate static java.lang.StringOPT_FILESprivate static java.lang.StringOPT_GEOMFUNCprivate static java.lang.StringOPT_GEOMOPprivate static java.lang.StringOPT_PROPERTIESprivate static java.lang.StringOPT_TESTCASEINDEXprivate static java.lang.StringOPT_VERBOSEprivate static java.lang.StringPROPERTY_TESTFILESprivate static ResultMatcherresultMatcher
-
Constructor Summary
Constructors Constructor Description JTSTestRunnerCmd()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>cmdOptionArgList(CommandLine commandLine, java.lang.String optionName)private static CommandLinecreateCommandLine()private static java.util.List<java.lang.String>extractTestFilenames(CommandLine commandLine)static GeometryOperationgetGeometryOperation()static ResultMatchergetResultMatcher()static booleanisGeometryOperationSpecified()Tests whether a GeometryOperation was specified on the command linestatic booleanisResultMatcherSpecified()Tests whether aResultMatcherwas specified on the command linestatic voidmain(java.lang.String[] args)private static voidprintHelp()private static JTSTestRunnerCmd.TestRunnerOptionsreadOptions(java.lang.String[] args)private java.lang.Stringreport(boolean isVerbose)private voidrun(JTSTestRunnerCmd.TestRunnerOptions options)
-
-
-
Field Detail
-
PROPERTY_TESTFILES
private static final java.lang.String PROPERTY_TESTFILES
- See Also:
- Constant Field Values
-
OPT_FILES
private static final java.lang.String OPT_FILES
- See Also:
- Constant Field Values
-
OPT_GEOMFUNC
private static final java.lang.String OPT_GEOMFUNC
- See Also:
- Constant Field Values
-
OPT_GEOMOP
private static final java.lang.String OPT_GEOMOP
- See Also:
- Constant Field Values
-
OPT_PROPERTIES
private static final java.lang.String OPT_PROPERTIES
- See Also:
- Constant Field Values
-
OPT_TESTCASEINDEX
private static final java.lang.String OPT_TESTCASEINDEX
- See Also:
- Constant Field Values
-
OPT_VERBOSE
private static final java.lang.String OPT_VERBOSE
- See Also:
- Constant Field Values
-
funcRegistry
private static GeometryFunctionRegistry funcRegistry
-
defaultOp
private static GeometryOperation defaultOp
-
geometryOp
private static GeometryOperation geometryOp
-
defaultResultMatcher
private static ResultMatcher defaultResultMatcher
-
resultMatcher
private static ResultMatcher resultMatcher
-
engine
private TestEngine engine
-
-
Method Detail
-
getGeometryOperation
public static GeometryOperation getGeometryOperation()
-
isGeometryOperationSpecified
public static boolean isGeometryOperationSpecified()
Tests whether a GeometryOperation was specified on the command line- Returns:
- true if a geometry operation was specified
-
getResultMatcher
public static ResultMatcher getResultMatcher()
-
isResultMatcherSpecified
public static boolean isResultMatcherSpecified()
Tests whether aResultMatcherwas specified on the command line- Returns:
- true if a matcher was specified
-
run
private void run(JTSTestRunnerCmd.TestRunnerOptions options) throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
report
private java.lang.String report(boolean isVerbose)
-
main
public static void main(java.lang.String[] args)
-
readOptions
private static JTSTestRunnerCmd.TestRunnerOptions readOptions(java.lang.String[] args) throws ParseException, java.io.FileNotFoundException, java.io.IOException
- Throws:
ParseExceptionjava.io.FileNotFoundExceptionjava.io.IOException
-
extractTestFilenames
private static java.util.List<java.lang.String> extractTestFilenames(CommandLine commandLine) throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
createCommandLine
private static CommandLine createCommandLine() throws ParseException
- Throws:
ParseException
-
printHelp
private static void printHelp()
-
cmdOptionArgList
public static java.util.List<java.lang.String> cmdOptionArgList(CommandLine commandLine, java.lang.String optionName)
-
-