Search in sources :

Example 16 with DescribeRecordResponseType

use of net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType in project ddf by codice.

the class TestCswEndpoint method testDescribeRecordSingleTypeSingleNamespaceNoPrefixesBadType.

@Test
public void testDescribeRecordSingleTypeSingleNamespaceNoPrefixesBadType() throws CswException {
    DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
    drr.setTypeName(BAD_TYPE);
    drr.setNamespace("xmlns(" + CswConstants.CSW_OUTPUT_SCHEMA + ")");
    DescribeRecordResponseType response = csw.describeRecord(drr);
    assertThat(response.getSchemaComponent(), is(empty()));
}
Also used : DescribeRecordRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest) DescribeRecordResponseType(net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType) Test(org.junit.Test)

Example 17 with DescribeRecordResponseType

use of net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType in project ddf by codice.

the class TestCswEndpoint method testDescribeRecordRequestSingleTypePassed.

@Test
public void testDescribeRecordRequestSingleTypePassed() {
    DescribeRecordRequest drr = createDefaultDescribeRecordRequest();
    drr.setTypeName(VALID_PREFIX_LOCAL_TYPE);
    LOGGER.info("Resource directory is {}", this.getClass().getResource(".").getPath());
    DescribeRecordResponseType drrt = null;
    try {
        drrt = csw.describeRecord(drr);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(drrt, notNullValue());
    assertThat(drrt.getSchemaComponent(), notNullValue());
    // Assert that it returned all record types.
    assertThat(drrt.getSchemaComponent().size(), is(1));
    LOGGER.info("got response \n{}\n", drrt.toString());
}
Also used : 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)

Example 18 with DescribeRecordResponseType

use of net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType in project ddf by codice.

the class TestCswEndpoint method testPostDescribeRecordRequestInvalidType.

@Test
public void testPostDescribeRecordRequestInvalidType() throws CswException {
    DescribeRecordType drt = createDefaultDescribeRecordType();
    List<QName> typeNames = new ArrayList<>();
    typeNames.add(new QName(CswConstants.CSW_OUTPUT_SCHEMA, VALID_TYPE, VALID_PREFIX));
    typeNames.add(new QName(CswConstants.CSW_OUTPUT_SCHEMA, BAD_TYPE, VALID_PREFIX));
    drt.setTypeName(typeNames);
    DescribeRecordResponseType response = csw.describeRecord(drt);
    assertThat(response.getSchemaComponent().size(), is(1));
}
Also used : DescribeRecordType(net.opengis.cat.csw.v_2_0_2.DescribeRecordType) QName(javax.xml.namespace.QName) DescribeRecordResponseType(net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

DescribeRecordResponseType (net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType)18 Test (org.junit.Test)17 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)13 SchemaComponentType (net.opengis.cat.csw.v_2_0_2.SchemaComponentType)12 DescribeRecordRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest)10 ArrayList (java.util.ArrayList)7 QName (javax.xml.namespace.QName)6 DescribeRecordType (net.opengis.cat.csw.v_2_0_2.DescribeRecordType)6 StringWriter (java.io.StringWriter)1 JAXBContext (javax.xml.bind.JAXBContext)1 JAXBElement (javax.xml.bind.JAXBElement)1 JAXBException (javax.xml.bind.JAXBException)1 Marshaller (javax.xml.bind.Marshaller)1