Class GetRecordByIdTests

java.lang.Object
org.opengis.cite.cat30.CommonFixture
org.opengis.cite.cat30.basic.GetRecordByIdTests

public class GetRecordByIdTests extends CommonFixture
Provides tests that apply to the GetRecordById request. This request implements the abstract GetResourceByID 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; this latter capability will be advertised in the capabilities document as an operational constraint as indicated below. The media type of a KVP request entity is "application/x-www-form-urlencoded".

<Post xmlns="http://www.opengis.net/ows/2.0"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xlink:href="http://cat.example.org/csw">
  <Constraint name="PostEncoding">
    <AllowedValues>
      <Value>KVP</Value>
    </AllowedValues>
  </Constraint>
</Post>

 

Sources

  • OGC 12-176r6, 7.4: GetRecordById operation
  • OGC 12-176r6, Table 16: Operation constraints
  • OGC 06-121r9, 7.4.7: OperationsMetadata section standard contents
  • Constructor Details

    • GetRecordByIdTests

      public GetRecordByIdTests()
  • Method Details

    • setIdList

      void setIdList(List<String> idList)
      Parameters:
      idList -
    • findRequestEndpoints

      @BeforeClass public void findRequestEndpoints()
      Finds the GET and POST method endpoints for the GetCapabilities request in the capabilities document.
    • getRecordIdentifiers

      @BeforeClass public void getRecordIdentifiers(org.testng.ITestContext testContext)
      Gets the record identifiers that occur in the sample data obtained from the SUT. Each csw:Record element must contain at least one dc:identifier element.
      Parameters:
      testContext - The test context containing various suite attributes.
    • getRecordById_noMatch

      public void getRecordById_noMatch()
      [Test] Verifies that a request for a record by identifier produces a response with status code 404 (Not Found) if no matching resource representation is found. A response entity (an exception report) is optional; if present, the exception code shall be "InvalidParameterValue".
      See Also:
      • "OGC 12-176r6, 7.4.4.2: 7.4.4.2 Id parameter"
    • getSummaryRecordById

      public void getSummaryRecordById()
      [Test] Verifies that a request for a record by identifier produces a matching csw:SummaryRecord in the response entity. The default view (element set) is "summary". The default output schema is identified by the namespace name "http://www.opengis.net/cat/csw/3.0".
      See Also:
      • "OGC 12-176r6, 7.4.4.2: Id parameter"
      • "OGC 12-176r6, 7.4.5: Response"
    • getBriefRecordById

      public void getBriefRecordById()
      [Test] Verifies that a request for a brief record by identifier produces a matching csw:BriefRecord in the response entity. The entity must be schema-valid.
      See Also:
      • "OGC 12-176r6, 7.4.4.1: ElementSetName parameter"
    • getFullRecordById

      public void getFullRecordById()
      [Test] Verifies that a request for a full record by identifier produces a matching csw:Record in the response entity. The entity must be schema-valid.
      See Also:
      • "OGC 12-176r6, 7.4.4.1: ElementSetName parameter"
    • getRecordByIdAsAtomEntryUsingAcceptHeader

      public void getRecordByIdAsAtomEntryUsingAcceptHeader()
      [Test] Verifies that a request for an Atom representation of a record produces a matching atom:entry in the response entity. The Accept request header indicates a preference for Atom content; the outputFormat parameter is omitted (thus the header value applies). The content of the entry must conform to RFC 4287.

      The atom:entry element is expected to include a dc:identifier element in accord with the mappings given in OGC 10-032r8, Table 7.

      <entry xmlns="http://www.w3.org/2005/Atom"
        xmlns:dc="http://purl.org/dc/elements/1.1/">
        <id>http://csw.example.org/record/ff711198-b30f-11e4-a71e-12e3f512a338</id>
        <title>Title</title>
        <updated>2015-02-12T23:46:57Z</updated>
        <dc:identifier>ff711198-b30f-11e4-a71e-12e3f512a338</dc:identifier>
      </entry>
      
       

      Sources

      • OGC 12-176r6, 7.4.4.4: outputSchema parameter
      • OGC 10-032r8, 9.3.2: Normal response XML encoding
      • RFC 4287: The Atom Syndication Format
    • getRecordByIdAsAtomEntryUsingOutputFormat

      public void getRecordByIdAsAtomEntryUsingOutputFormat()
      [Test] Verifies that a request for an Atom representation of a record produces a matching atom:entry in the response entity. The outputFormat query parameter value ("application/atom+xml") overrides the Accept request header ("application/xml").
    • getRecordByIdWithUnsupportedFormat

      public void getRecordByIdWithUnsupportedFormat()
      [Test] Verifies that a request for a record representation in an unsupported format (media type) produces an exception report containing the exception code "InvalidParameterValue". The "outputFormat" parameter has the value "model/vnd.collada+xml".
      See Also:
      • "OGC 12-176r6, 7.4.4.3: outputFormat parameter"
    • getRecordByIdWithUnsupportedSchema

      public void getRecordByIdWithUnsupportedSchema()
      [Test] Verifies that a request for a record that conforms to an unsupported output schema produces an exception report containing the exception code "InvalidParameterValue". The "outputSchema" parameter has the value "http://www.example.org/ns/alpha".
      See Also:
      • "OGC 12-176r6, 7.4.4.4: outputSchema parameter"
    • getRecordByIdWithMissingId

      public void getRecordByIdWithMissingId()
      [Test] Verifies that a request for a record that omits the required 'id' parameter produces an exception report containing the exception code "MissingParameterValue".
      See Also:
      • "OGC 12-176r6, Table 21: KVP encoding for GetRecordById operation request"