Class CommonFixture

java.lang.Object
org.opengis.cite.cat30.CommonFixture
Direct Known Subclasses:
BasicGetRecordsTests, BasicSearchTests, GetCapabilitiesTests, GetRecordByIdTests, OpenSearchCoreTests, OpenSearchDescriptionTests, OpenSearchGeoTests

public class CommonFixture extends Object
A supporting base class that sets up a common test fixture. These configuration methods are invoked before those defined in a subclass.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Schema
    An immutable Schema object for validating Atom feeds/entries (RFC 4287, Appendix B).
    protected jakarta.ws.rs.client.Client
    HTTP client component (JAX-RS Client API).
    protected Document
    Service capabilities document (csw:Capabilities).
    protected Schema
    An immutable Schema object for validating all CSW 3.0 messages (cswAll.xsd).
    protected org.glassfish.jersey.client.ClientRequest
    An HTTP request message.
    protected jakarta.ws.rs.core.Response
    An HTTP response message.
    static final String
    Root test suite package (absolute path).
    static final String
    Classpath reference for Schematron schema (Atom feed).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Response
    buildGetRequest(URI endpoint, Map<String,String> qryParams, jakarta.ws.rs.core.MediaType... mediaTypes)
    Builds an HTTP request message that uses the GET method.
    void
    clearMessages.
    getResponseEntityAsDocument(jakarta.ws.rs.core.Response response, String targetURI)
    Obtains the (XML) response entity as a DOM Document.
    void
    initCommonFixture(org.testng.ITestContext testContext)
    Initializes the common test fixture with the following objects: a client component for interacting with HTTP endpoints the CSW message schema (obtained from the suite attribute SuiteAttribute.CSW_SCHEMA, a thread-safe Schema object). the Atom schema (obtained from the suite attribute SuiteAttribute.ATOM_SCHEMA, a thread-safe Schema object). the service capabilities document (obtained from the suite attribute SuiteAttribute.TEST_SUBJECT, which should evaluate to a DOM Document node).

    Methods inherited from class java.lang.Object

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

    • ROOT_PKG_PATH

      public static final String ROOT_PKG_PATH
      Root test suite package (absolute path).
      See Also:
    • SCHEMATRON_ATOM

      public static final String SCHEMATRON_ATOM
      Classpath reference for Schematron schema (Atom feed).
      See Also:
    • client

      protected jakarta.ws.rs.client.Client client
      HTTP client component (JAX-RS Client API).
    • cswCapabilities

      protected Document cswCapabilities
      Service capabilities document (csw:Capabilities).
    • cswSchema

      protected Schema cswSchema
      An immutable Schema object for validating all CSW 3.0 messages (cswAll.xsd).
    • atomSchema

      protected Schema atomSchema
      An immutable Schema object for validating Atom feeds/entries (RFC 4287, Appendix B).
    • request

      protected org.glassfish.jersey.client.ClientRequest request
      An HTTP request message.
    • response

      protected jakarta.ws.rs.core.Response response
      An HTTP response message.
  • Constructor Details

    • CommonFixture

      public CommonFixture()
  • Method Details

    • initCommonFixture

      @BeforeClass public void initCommonFixture(org.testng.ITestContext testContext)
      Initializes the common test fixture with the following objects:
      • a client component for interacting with HTTP endpoints
      • the CSW message schema (obtained from the suite attribute SuiteAttribute.CSW_SCHEMA, a thread-safe Schema object).
      • the Atom schema (obtained from the suite attribute SuiteAttribute.ATOM_SCHEMA, a thread-safe Schema object).
      • the service capabilities document (obtained from the suite attribute SuiteAttribute.TEST_SUBJECT, which should evaluate to a DOM Document node).
      Parameters:
      testContext - The test context that contains all the information for a test run, including suite attributes.
    • clearMessages

      @BeforeMethod public void clearMessages()

      clearMessages.

    • getResponseEntityAsDocument

      public Document getResponseEntityAsDocument(jakarta.ws.rs.core.Response response, String targetURI)
      Obtains the (XML) response entity as a DOM Document. This convenience method wraps a static method call to facilitate unit testing (Mockito workaround).
      Parameters:
      response - A representation of an HTTP response message.
      targetURI - The target URI from which the entity was retrieved (may be null).
      Returns:
      A Document representing the entity.
      See Also:
    • buildGetRequest

      public jakarta.ws.rs.core.Response buildGetRequest(URI endpoint, Map<String,String> qryParams, jakarta.ws.rs.core.MediaType... mediaTypes)
      Builds an HTTP request message that uses the GET method. This convenience method wraps a static method call to facilitate unit testing (Mockito workaround).
      Parameters:
      endpoint - A URI indicating the target resource.
      qryParams - A Map containing query parameters (may be null);
      mediaTypes - A list of acceptable media types; if not specified, generic XML ("application/xml") is preferred.
      Returns:
      A ClientRequest object.
      See Also: