Class TestReader


  • public class TestReader
    extends java.lang.Object
    Version:
    1.7
    • Constructor Detail

      • TestReader

        public TestReader()
    • Method Detail

      • isBooleanFunction

        public boolean isBooleanFunction​(java.lang.String name)
      • isIntegerFunction

        public boolean isIntegerFunction​(java.lang.String name)
      • isDoubleFunction

        public boolean isDoubleFunction​(java.lang.String name)
      • isGeometryFunction

        public boolean isGeometryFunction​(java.lang.String name)
      • getParsingProblems

        public java.util.List getParsingProblems()
      • clearParsingProblems

        public void clearParsingProblems()
      • createTestRun

        public TestRun createTestRun​(java.io.File testFile,
                                     int runIndex)
      • parseTests

        private java.util.List parseTests​(java.util.List testElements,
                                          int caseIndex,
                                          java.io.File testFile,
                                          TestCase testCase,
                                          double tolerance)
                                   throws TestParseException
        Creates a List of Test's from the given Element's.
        Throws:
        TestParseException
      • parseTestCases

        private java.util.List parseTestCases​(java.util.List caseElements,
                                              java.io.File testFile,
                                              TestRun testRun,
                                              double tolerance)
                                       throws TestParseException
        Creates a List of TestCase's from the given Element's.
        Throws:
        TestParseException
      • parsePrecisionModel

        private PrecisionModel parsePrecisionModel​(org.jdom2.Element runElement)
                                            throws TestParseException
        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
      • 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

        private ResultMatcher parseResultMatcher​(org.jdom2.Element runElement)
                                          throws TestParseException
        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
      • getInstance

        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.
        Returns:
        an instance of the class, if it is assignment-compatible, or null if the requested class is not assigment-compatible
      • readGeometry

        private Geometry readGeometry​(org.jdom2.Element geometryElement,
                                      java.io.File wktFile)
                               throws java.io.FileNotFoundException,
                                      ParseException,
                                      java.io.IOException
        Throws:
        java.io.FileNotFoundException
        ParseException
        java.io.IOException
      • toString

        private java.lang.String toString​(java.util.List stringList)
      • absoluteWktFile

        private java.io.File absoluteWktFile​(java.io.File wktFile,
                                             TestRun testRun)
      • getContents

        public static java.util.List getContents​(java.lang.String textFileName)
                                          throws java.io.FileNotFoundException,
                                                 java.io.IOException
        Returns a List of the String's in the text file, one per line.
        Throws:
        java.io.FileNotFoundException
        java.io.IOException