Class XMLSchemaTests
java.lang.Object
org.opengis.cite.iso19136.general.XMLSchemaTests
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
Modifier and TypeFieldDescription(package private) static final long
Timeout for compiling schemas /ms -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Field Details
-
COMPILE_TIMEOUT
static final long COMPILE_TIMEOUTTimeout 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 attributeSuiteAttribute.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
[@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
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.
-