Class XMLSchemaTests

java.lang.Object
org.opengis.cite.iso19136.general.XMLSchemaTests

public class XMLSchemaTests extends Object
Verifies that an XML Schema resource conforms to the W3C XML Schema Recommendation. This is a fundamental requirement; if any XML Schema constraints are violated all remaining tests should be skipped.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final long
    Timeout for compiling schemas /ms
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    compileXMLSchema(org.testng.ITestContext testContext)
    [@Test] Verifies the validity of the GML application schema XML document with respect to the W3C XML Schema specification.
    void
    getSchemaURIsFromTestContext(org.testng.ITestContext testContext)
    Obtains the schema locations from the ISuite context.
    (package private) void
    setSchemaLocations(Set<URI> schemaURIs)
    Sets the application schema(s) to check.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COMPILE_TIMEOUT

      static final long COMPILE_TIMEOUT
      Timeout for compiling schemas /ms
      See Also:
  • Constructor Details

    • XMLSchemaTests

      public XMLSchemaTests()
  • Method Details

    • getSchemaURIsFromTestContext

      @BeforeClass public void getSchemaURIsFromTestContext(org.testng.ITestContext testContext)
      Obtains the schema locations from the ISuite context. The suite attribute SuiteAttribute.SCHEMA_LOC_SET should evaluate to a Set of URI objects specifying the locations of the relevant XML Schema grammars.
      Parameters:
      testContext - The test (group) context.
    • compileXMLSchema

      public void compileXMLSchema(org.testng.ITestContext testContext) throws SAXException, IOException
      [@Test] Verifies the validity of the GML application schema XML document with respect to the W3C XML Schema specification. It must satisfy all relevant constraints imposed by the XML Schema specification.

      If the schema is successfully compiled with no errors it is added to the ISuite context as the value of the schema attribute. The resulting (immutable, thread-safe) Schema object may then be used to construct a Validator.

      A fail verdict is produced if it takes longer than 60000L ms to compile the schema(s).

      Parameters:
      testContext - The test (group) context.
      Throws:
      SAXException - If a schema cannot be read.
      IOException - If a schema resource cannot be accessed for any reason.
      See Also:
      • "ISO 19136:2007, cl. A.1.1.4 (Valid XML Schema)"
    • setSchemaLocations

      void setSchemaLocations(Set<URI> schemaURIs)
      Sets the application schema(s) to check. This method is intended only to facilitate unit testing.
      Parameters:
      schemaURIs - A Set of URI objects representing schema locations.