Class OpenSearchDescriptionTests

java.lang.Object
org.opengis.cite.cat30.CommonFixture
org.opengis.cite.cat30.opensearch.OpenSearchDescriptionTests

public class OpenSearchDescriptionTests extends CommonFixture
Verifies the structure and content of the OpenSearch description document obtained from the SUT. The document is obtained in response to a GET request submitted to the base service endpoint where the Accept request header expresses a preference for any of the following media types:
  • application/vnd.a9.opensearchdescription+xml
  • application/opensearchdescription+xml

Note: None of the media types listed above appear in the IANA media type registry. Registrations in the standards tree must be approved by the IESG or originate from a recognized standards-related organization (see RFC 6838); third-party registrations are allowed in the vendor tree.

Sources

  • Field Details

    • OPENSEARCH_CONSTRAINT

      public static final String OPENSEARCH_CONSTRAINT
      Constant OPENSEARCH_CONSTRAINT="OpenSearchDescriptionDocument"
      See Also:
  • Constructor Details

    • OpenSearchDescriptionTests

      public OpenSearchDescriptionTests()
  • Method Details

    • initFixture

      @BeforeClass public void initFixture(org.testng.ITestContext testContext)
      Initializes the test fixture by:
      • building a Relax NG schema validator for an OpenSearch description document; the schema resource is located on the classpath at this location: /org/opengis/cite/cat30/rnc/osd-1.1-draft5.rnc
      • extracting the base GetCapabilities URL (for the GET method binding) from the capabilities document
      Parameters:
      testContext - The test context containing various suite attributes.
    • preferOpenSearchDescription

      public void preferOpenSearchDescription()
      [Test] Requests an OpenSearch description document as the most preferred media type. The generic XML media type is included in the Accept header with a q parameter value < 1:
      Accept: application/xml; q=0.5, application/opensearchdescription+xml
    • validOpenSearchDescription

      public void validOpenSearchDescription() throws SAXException, IOException
      [Test] Validates the OpenSearch description document obtained from the IUT. The document is checked against the constraints in the OpenSearch 1.1 draft 5 specification.
      Throws:
      SAXException - If the document cannot be read.
      IOException - If an I/O error occurs while trying to access the document.
      See Also:
      • "[CAT-HTTP], 6.5.6.5: Requirements for an OpenSearch enabled CSW"
    • getOpenSearchDescriptionFromCapabilities

      public void getOpenSearchDescriptionFromCapabilities()
      [Test] Attempts to retrieve an OpenSearch description document using the URI presented in the capabilities document as the value of the "OpenSearchDescriptionDocument" constraint.
      See Also:
      • "[CAT-HTTP], 6.5.6.2, Table 16"