Class OpenSearchDescriptionTests
java.lang.Object
org.opengis.cite.cat30.CommonFixture
org.opengis.cite.cat30.opensearch.OpenSearchDescriptionTests
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
- OGC 12-176r5, 6.4: Obtaining service metadata
- OGC 12-176r5, 6.5.6: Enabling OpenSearch
- OpenSearch description elements
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ConstantOPENSEARCH_CONSTRAINT="OpenSearchDescriptionDocument"
Fields inherited from class org.opengis.cite.cat30.CommonFixture
atomSchema, client, cswCapabilities, cswSchema, request, response, ROOT_PKG_PATH, SCHEMATRON_ATOM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
[Test] Attempts to retrieve an OpenSearch description document using the URI presented in the capabilities document as the value of the "OpenSearchDescriptionDocument" constraint.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 documentvoid
[Test] Requests an OpenSearch description document as the most preferred media type.void
[Test] Validates the OpenSearch description document obtained from the IUT.Methods inherited from class org.opengis.cite.cat30.CommonFixture
buildGetRequest, clearMessages, getResponseEntityAsDocument, initCommonFixture
-
Field Details
-
OPENSEARCH_CONSTRAINT
ConstantOPENSEARCH_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.
- building a Relax NG schema validator for an OpenSearch description document;
the schema resource is located on the classpath at this location:
-
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
[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"
-