Search in sources :

Example 16 with DescribeRecordRequest

use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.

the class TestCswEndpoint method createDefaultDescribeRecordRequest.

/**
     * Creates default DescribeRecordRequest GET request, with no sections specified
     *
     * @return Vanilla DescribeRecordRequest object
     */
private DescribeRecordRequest createDefaultDescribeRecordRequest() {
    DescribeRecordRequest drr = new DescribeRecordRequest();
    drr.setService(CswConstants.CSW);
    drr.setVersion(CswConstants.VERSION_2_0_2);
    drr.setRequest(CswConstants.DESCRIBE_RECORD);
    drr.setNamespace("xmlns(" + VALID_PREFIX + "=" + CswConstants.CSW_OUTPUT_SCHEMA + ")");
    return drr;
}
Also used : DescribeRecordRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest)

Example 17 with DescribeRecordRequest

use of org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest in project ddf by codice.

the class TestCswEndpoint method testDescribeRecordSingleTypeSingleNamespaceNoPrefixes.

@Test
public void testDescribeRecordSingleTypeSingleNamespaceNoPrefixes() {
    DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
    drr.setTypeName(VALID_TYPE);
    drr.setNamespace("xmlns(" + CswConstants.CSW_OUTPUT_SCHEMA + ")");
    DescribeRecordResponseType drrt = null;
    try {
        drrt = csw.describeRecord(drr);
    } catch (CswException e) {
        fail("DescribeRecord failed with message '" + e.getMessage() + "'");
    }
    assertThat(drrt, notNullValue());
    assertThat(drrt.getSchemaComponent(), notNullValue());
    List<SchemaComponentType> schemaComponents = drrt.getSchemaComponent();
    assertThat(schemaComponents.size(), is(1));
}
Also used : SchemaComponentType(net.opengis.cat.csw.v_2_0_2.SchemaComponentType) DescribeRecordRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest) DescribeRecordResponseType(net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Test(org.junit.Test)

Aggregations

DescribeRecordRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest)17 Test (org.junit.Test)15 DescribeRecordResponseType (net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType)10 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)9 SchemaComponentType (net.opengis.cat.csw.v_2_0_2.SchemaComponentType)6