Package org.opengis.cite.cat30.basic
Class GetCapabilitiesTests
java.lang.Object
org.opengis.cite.cat30.CommonFixture
org.opengis.cite.cat30.basic.GetCapabilitiesTests
Provides tests pertaining to the
GetCapabilities
request. This request
implements the abstract getCapabilities operation defined in the OGCWebService
interface (OGC 06-121r9, Figure C.2).
The KVP syntax must be supported; this encoding is generally used with the GET method but may also be used with the POST method. The media type of a KVP request entity is "application/x-www-form-urlencoded".
Sources
- OGC 06-121r9, 7: GetCapabilities operation
- OGC 12-176r6, 7.1: GetCapabilities operation
-
Field Summary
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
Finds the GET method endpoint for the GetCapabilities request in the capabilities document.void
[Test] Verifies that a request for a part of a capabilities document produces the expected response entity.void
[Test] Attempts to retrieve the capabilities document from the base URL (endpoint for GetCapabilities via GET).void
[Test] Attempts to retrieve the capabilities document from the base URL (endpoint for GetCapabilities via GET).void
[Test] Verifies that a request for a supported representation (format) of a capabilities document produces the expected response entity.void
[Test] Verifies that a request for a known but unsupported representation (format) of a capabilities document produces an exception report containing the exception code "InvalidParameterValue".void
[Test] If the required "service" parameter is missing, an exception report with status code 400 must be produced.void
[Test] Query parameter values must be handled in a case-sensitive manner.void
[Test] Query parameter names must be handled in a case-insensitive manner.void
[Test] Verifies that a request for an unsupported version of a capabilities document produces an exception report containing the exception code "VersionNegotiationFailed".void
[Test] Verifies that the content of a complete service capabilities document is schema-valid.void
setServiceCapabilities
(Document cswCapabilities) Sets the service capabilities document.Methods inherited from class org.opengis.cite.cat30.CommonFixture
buildGetRequest, clearMessages, getResponseEntityAsDocument, initCommonFixture
-
Constructor Details
-
GetCapabilitiesTests
public GetCapabilitiesTests()
-
-
Method Details
-
findServiceEndpoint
@BeforeClass public void findServiceEndpoint()Finds the GET method endpoint for the GetCapabilities request in the capabilities document. -
setServiceCapabilities
Sets the service capabilities document. This method is intended to facilitate unit testing.- Parameters:
cswCapabilities
- A Document node representing a service description (csw:Capabilities).
-
getFullCapabilitiesAcceptVersion3
public void getFullCapabilitiesAcceptVersion3()[Test] Verifies that the content of a complete service capabilities document is schema-valid. All implementations must support the GET method for a GetCapabilities request.The
Accept
request header expresses a preference for a representation of type "application/xml".- See Also:
-
- "OGC 06-121r9, 7.2.1: GetCapabilities request parameters"
-
getCapabilitiesFromBaseURL
public void getCapabilitiesFromBaseURL()[Test] Attempts to retrieve the capabilities document from the base URL (endpoint for GetCapabilities via GET). The Accept header indicates that any media type is acceptable ("*/*"); this is equivalent to omitting the Accept header. The response shall include a complete XML representation.- See Also:
-
- "OGC 12-176r6, 6.4: Obtaining service metadata"
-
getCapabilitiesFromBaseURLAsXML
public void getCapabilitiesFromBaseURLAsXML()[Test] Attempts to retrieve the capabilities document from the base URL (endpoint for GetCapabilities via GET). The Accept header indicates XML as the preferred media type:Accept: text/html; q=0.5, application/xml
The response shall include a complete XML representation.- See Also:
-
- "OGC 12-176r6, 6.4: Obtaining service metadata"
-
getCapabilitiesWithMixedCaseParamNames
public void getCapabilitiesWithMixedCaseParamNames()[Test] Query parameter names must be handled in a case-insensitive manner. The parameter names are all presented in mixed case; a complete capabilities document is expected in response.- See Also:
-
- "OGC 12-176r5, 6.5.4: KVP encoding rules"
-
getCapabilitiesWithInvalidParamValue
public void getCapabilitiesWithInvalidParamValue()[Test] Query parameter values must be handled in a case-sensitive manner. The request specifiesrequest=getCapabilities
; an exception report is expected in response with OGC exception code "InvalidParameterValue" and status code 400.- See Also:
-
- "OGC 12-176r5, 6.5.4: KVP encoding rules"
- "OGC 06-121r9, Table 28: Standard exception codes and meanings"
-
getCapabilitiesIsMissingServiceParam
public void getCapabilitiesIsMissingServiceParam()[Test] If the required "service" parameter is missing, an exception report with status code 400 must be produced. The expected OGC exception code is "MissingParameterValue".- See Also:
-
- "OGC 12-176r5, Table 5: KVP encoding of common operation request parameters"
-
getCapabilitiesWithUnsupportedVersion
public void getCapabilitiesWithUnsupportedVersion()[Test] Verifies that a request for an unsupported version of a capabilities document produces an exception report containing the exception code "VersionNegotiationFailed". The status code must be 400 (Bad Request) and the response entity must be an XML document having {http://www.opengis.net/ows/2.0}ExceptionReport as the document element.- See Also:
-
- "OGC 06-121r9, 7.3.2: Version negotiation"
-
getCapabilitiesInUnsupportedFormat
public void getCapabilitiesInUnsupportedFormat()[Test] Verifies that a request for a known but unsupported representation (format) of a capabilities document produces an exception report containing the exception code "InvalidParameterValue". The status code must be 400 (Bad Request) and the response entity must be an XML document having {http://www.opengis.net/ows/2.0}ExceptionReport as the document element.- See Also:
-
- "OGC 06-121r9, Table 5: GetCapabilities operation request URL parameters"
-
getCapabilitiesInSupportedFormat
public void getCapabilitiesInSupportedFormat()[Test] Verifies that a request for a supported representation (format) of a capabilities document produces the expected response entity. All supported formats must be listed in the capabilities document as values of the "AcceptFormats" parameter. The media type "text/xml" must be supported, but it need not be explicitly listed.- See Also:
-
- "OGC 06-121r9, 7.3.5: AcceptFormats parameter"
- "OGC 12-176, Table 15"
-
getCapabilitiesBySection
public void getCapabilitiesBySection()[Test] Verifies that a request for a part of a capabilities document produces the expected response entity. All recognized section names must be listed in the capabilities document as values of the "Sections" parameter; the value "All" indicates that a complete document is requested.The possible section names are listed below.
- All
- ServiceIdentification
- ServiceProvider
- OperationsMetadata
- Filter_Capabilities
- See Also:
-
- "OGC 06-121r9, 7.3.3: Sections parameter"
- "OGC 12-176, Table 12"
-