Class DataFixture

java.lang.Object
org.opengis.cite.iso19136.data.DataFixture
Direct Known Subclasses:
CompositeCurveTests, CurveTests, EnvelopeTests, LineStringTests, PointTests, PropertyValueTests, SchematronTests, SurfaceTests, XMLSchemaValidationTests

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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected File
    A File containing GML data.
    protected org.apache.xerces.xs.XSModel
    An XSModel object representing a GML application schema.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    void
    initDataFixture(org.testng.ITestContext testContext)
    A configuration method (BeforeClass) that initializes the test fixture as follows: Obtain the GML data set from the test context.
    void
    setDataFile(File dataFile)
    Sets the data file.
    void
    setSchemaModel(org.apache.xerces.xs.XSModel xsModel)
    Sets the schema model (for unit testing purposes).

    Methods inherited from class java.lang.Object

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

    • dataFile

      protected File dataFile
      A File containing GML data.
    • model

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

    • DataFixture

      public DataFixture()
  • Method Details

    • initDataFixture

      @BeforeClass(alwaysRun=true) public void initDataFixture(org.testng.ITestContext testContext)
      A configuration method (BeforeClass) that initializes the test fixture as follows:
      1. Obtain the GML data set from the test context. The suite attribute SuiteAttribute.GML should evaluate to a File object containing the GML data. If no such file reference exists the tests are skipped.
      2. Obtain the schema model from the test context. The suite attribute model should evaluate to an XSModel object representing the GML application schema.
      Parameters:
      testContext - The test (group) context.
    • 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.