Class BaseFixture

java.lang.Object
org.opengis.cite.iso19142.BaseFixture
Direct Known Subclasses:
BasicCapabilitiesTests, BasicGetFeatureTests, CreateStoredQueryTests, DescribeFeatureTypeTests, DescribeStoredQueriesTests, DropStoredQueryTests, GetPropertyValueTests, ListStoredQueriesTests, LockingCapabilitiesTests, LockingFixture, PagingTests, QueryFilterFixture, ServiceMetadataTests, SimpleCapabilitiesTests, StoredQueryTests, TransactionCapabilitiesTests, TransactionFixture, VersioningTests

public class BaseFixture extends Object
A supporting base class that provides common configuration methods and data providers. The configuration methods are invoked before any that may be defined in a subclass.
  • Field Details

    • ETS_PKG

      protected static final String ETS_PKG
      Root ETS package.
      See Also:
    • wfsMetadata

      protected Document wfsMetadata
      A DOM document containing service metadata (OGC capabilities).
    • wfsClient

      protected WFSClient wfsClient
      A client component for interacting with a WFS.
    • supportedBindings

      protected Set<ProtocolBinding> supportedBindings
    • featureTypes

      protected List<QName> featureTypes
    • featureInfo

      protected Map<QName,FeatureTypeInfo> featureInfo
    • docBuilder

      protected DocumentBuilder docBuilder
      A DOM parser.
    • TNS_PREFIX

      protected static final String TNS_PREFIX
      See Also:
    • reqEntity

      protected Document reqEntity
      A Document representing the content of the request message.
    • rspEntity

      protected Document rspEntity
      A Document representing the content of the response message.
    • wfsVersion

      protected String wfsVersion
      Highest version supported by the IUT.
  • Constructor Details

    • BaseFixture

      public BaseFixture()
  • Method Details

    • setWfsClient

      public void setWfsClient(WFSClient wfsClient)
    • initBaseFixture

      @BeforeClass(alwaysRun=true) public void initBaseFixture(org.testng.ITestContext testContext)
      Sets up the base fixture. The service metadata document is obtained from the ISuite context. The suite attribute testSubject should yield a DOM Document node having {http://www.opengis.net/wfs/2.0}WFS_Capabilities as the document element. The set of implemented protocol bindings is determined from the service metadata by checking the values of the following service constraints:
      • KVPEncoding
      • XMLEncoding
      • SOAPEncoding
      Parameters:
      testContext - The test (set) context.
    • initParser

      @BeforeClass public void initParser()
      Initializes the (namespace-aware) DOM parser.
    • addAttributesOnTestFailure

      @AfterMethod public void addAttributesOnTestFailure(org.testng.ITestResult result)
      Augments the test result with supplementary attributes in the event that a test method failed. The "request" attribute contains a String representing the request entity (POST method) or query component (GET method). The "response" attribute contains the content of the response entity.
      Parameters:
      result - A description of the test result.
    • getProtocolBindings

      @DataProvider(name="protocol-binding") public Object[][] getProtocolBindings(org.testng.ITestContext testContext)
      A DataProvider that supplies the set of application protocol bindings supported by the SUT.
      Parameters:
      testContext - Supplies details about the test run.
      Returns:
      An Object[][] array containing a ProtocolBinding object in each row (first dimension).
    • getFeatureTypes

      @DataProvider(name="feature-types") public Object[][] getFeatureTypes()
      A DataProvider that supplies the complete set of feature types recognized by the SUT.
      Returns:
      An Object[][] array containing a QName object in each row (first dimension).
    • getInstantiatedFeatureTypes

      @DataProvider(name="instantiated-feature-types") public Iterator<Object[]> getInstantiatedFeatureTypes()
      A DataProvider that supplies feature type names for which instances exist.
      Returns:
      An Iterator over an array containing a QName object representing the qualified name of a feature type.
    • allProtocolsAndFeatureTypes

      @DataProvider(name="all-protocols-featureTypes") public Iterator<Object[]> allProtocolsAndFeatureTypes()
      A DataProvider that supplies parameters specifying a supported protocol binding and a feature type. The resulting set is given by the Cartesian product of the sets {bindings} x {featureTypes}; its cardinality is equal to the product of the cardinalities of the two input sets.
      Returns:
      An Iterator<Object[]> over the set of (ProtocolBinding, QName) pairs.
    • bindingAndAvailFeatureTypeProductSet

      @DataProvider(name="protocol-featureType") public Iterator<Object[]> bindingAndAvailFeatureTypeProductSet(org.testng.ITestContext testContext)
      A DataProvider that supplies a collection of parameter tuples (a product set) where each tuple has two elements:
      1. ProtocolBinding - a supported request binding
      2. QName - the name of a feature type for which data are available
      Parameters:
      testContext - The ITestContext object for the test run.
      Returns:
      Iterator<Object[]> An iterator over a collection of parameter tuples (ProtocolBinding, QName).
    • extractBodyAsDocument

      protected Document extractBodyAsDocument(jakarta.ws.rs.core.Response rsp)
      Extracts the body of the response message as a DOM Document node. For a SOAP response this will contain the content of the SOAP body element.
      Parameters:
      rsp - A Response representing an HTTP response message.
      Returns:
      A Document representing the response entity, or null if it could not be parsed.