Class DataFixture

java.lang.Object
org.opengis.cite.swecommon20.level1.DataFixture
Direct Known Subclasses:
AdvancedEncodings, AdvancedEncodingsSchema, BlockComponents, ChoiceComponents, CoreConcept, GeneralEncodingRules, RecordComponents, SimpleComponents, SimpleComponentsSchemas, SimpleEncodings

public class DataFixture extends Object
A supporting base class that provides a common fixture for validating data sets. The configuration methods are invoked before any that may be defined in a subclass.
  • Field Details

    • dataFile

      protected File dataFile
      Files containing tested subject.
    • originalSubject

      protected Document originalSubject
    • testSubject

      protected Document testSubject
    • testSubjectUri

      protected URI testSubjectUri
    • Resource_GML_Path

      protected String Resource_GML_Path
    • Resource_SWE_Path

      protected String Resource_SWE_Path
    • model

      protected org.apache.xerces.xs.XSModel model
      An XSModel object representing a GML application schema.
  • Constructor Details

    • DataFixture

      public DataFixture()

      Constructor for DataFixture.

  • Method Details

    • CreateValidator

      public Validator CreateValidator(URL xsdPath) throws XMLStreamException, SAXException, IOException

      CreateValidator.

      Parameters:
      xsdPath - a URL object
      Returns:
      a Validator object
      Throws:
      XMLStreamException - if any.
      SAXException - if any.
      IOException - if any.
    • CheckXPath2

      public String CheckXPath2(String xpath)
      Check XPath2.0
      Parameters:
      xpath - String denoting an xpath syntax
      Returns:
      XdmValue converted to string
    • obtainTestSubject

      @BeforeClass(alwaysRun=true) public void obtainTestSubject(org.testng.ITestContext testContext)

      obtainTestSubject.

      Parameters:
      testContext - a ITestContext object
    • setDataFile

      public void setDataFile(File dataFile)
      Sets the data file. This is a convenience method intended to facilitate unit testing.
      Parameters:
      dataFile - A File containing the data to be validated.
    • setSchemaModel

      public void setSchemaModel(org.apache.xerces.xs.XSModel xsModel)
      Sets the schema model (for unit testing purposes).
      Parameters:
      xsModel - An XSModel object representing a GML application schema.
    • generateXPathExpression

      public String generateXPathExpression(List<QName> elemNames, Map<String,String> namespaceBindings)
      Generates an XPath expression to find all instances of the given elements in the data being validated. The supplied namespace bindings will be supplemented if necessary.
      Parameters:
      elemNames - A list of qualified names corresponding to element declarations.
      namespaceBindings - A collection of namespace bindings required to evaluate the XPath expression, where each entry maps a namespace URI (key) to a prefix (value).
      Returns:
      An XPath (1.0) expression.