Class SchematronTests
java.lang.Object
org.opengis.cite.sensorml20.level1.DataFixture
org.opengis.cite.sensorml20.level2.SchematronTests
Verifies that a SensorML instance document adheres to the constraints defined in
Schematron schemas. An application-specific schema may be associated with the instance
document by either of the following means:
- Specify the schema location using the
xml-modelprocessing instruction, where the value of the "schematypens" data item is the name of the Schematron namespace (see sample listing below). - Specify the schema location as the value of the
schtest run argument;
Using the xml-model PI to refer to a Schematron schema
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://example.org/constraints.sch"
schematypens="http://purl.oclc.org/dsdl/schematron"
phase="#ALL"?>
The processing instruction takes precedence if multiple schema references are found.
Sources
-
Field Summary
Fields inherited from class org.opengis.cite.sensorml20.level1.DataFixture
dataFile, model -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of AggregateProcess.void[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of Core.void[Test] Verifies that a GML instance satisfies the additional Schematron constraints specified in ISO 19136.void[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of PhysicalComponent.void[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of PhysicalComponent.void[Test] Validates a XML document against a set of Schematron constraints associated with it using either thexml-modelprocessing instruction or theschtest run argument.void[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of SimpleProcess.voidcreateSchematronValidator(org.testng.ITestContext testContext) Attempts to construct a Schematron validator from a schema reference given in (a) the SML data file, or (b) a test run argument (in the ISuite context).getXmlModelPIData(File dataFile) Extracts the data items from thexml-modelprocessing instruction.(package private) booleanisSchematronReference(Map<String, String> piData) Indicates whether or not the given PI data includes a Schematron schema reference.Methods inherited from class org.opengis.cite.sensorml20.level1.DataFixture
generateXPathExpression, initDataFixture, setDataFile, setSchemaModel
-
Constructor Details
-
SchematronTests
public SchematronTests()
-
-
Method Details
-
createSchematronValidator
public void createSchematronValidator(org.testng.ITestContext testContext) Attempts to construct a Schematron validator from a schema reference given in (a) the SML data file, or (b) a test run argument (in the ISuite context).- Parameters:
testContext- The test set context.
-
checkCoreConstraints
public void checkCoreConstraints()[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of Core.Sources
-
checkSimpleProcessConstraints
public void checkSimpleProcessConstraints()[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of SimpleProcess.Sources
-
checkAggregateProcessConstraints
public void checkAggregateProcessConstraints()[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of AggregateProcess.Sources
-
checkPhysicalComponentConstraints
public void checkPhysicalComponentConstraints()[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of PhysicalComponent.Sources
-
checkPhysicalSystemConstraints
public void checkPhysicalSystemConstraints()[Test] Verifies that a SensorML instance satisfies the additional Schematron constraints specified in the conformance classes of PhysicalComponent.Sources
-
checkGMLSchematronConstraints
public void checkGMLSchematronConstraints()[Test] Verifies that a GML instance satisfies the additional Schematron constraints specified in ISO 19136.Sources
-
checkSchematronConstraints
public void checkSchematronConstraints()[Test] Validates a XML document against a set of Schematron constraints associated with it using either thexml-modelprocessing instruction or theschtest run argument. -
isSchematronReference
Indicates whether or not the given PI data includes a Schematron schema reference.- Parameters:
piData- A Map containing PI data (pseudo-attributes).- Returns:
trueif the "schematypens" pseudo-attribute has the value otherwise;
-
getXmlModelPIData
Extracts the data items from thexml-modelprocessing instruction. The PI must appear before the document element.- Parameters:
dataFile- A File containing the GML instance.- Returns:
- A Map containing the supplied pseudo-attributes, or
nullif the PI is not present.
-