Search in sources :

Example 36 with DescribeRecordResponseType

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

the class CswEndpointTest method testPostDescribeRecordRequestSingleTypePassed.

@Test
public void testPostDescribeRecordRequestSingleTypePassed() {
    DescribeRecordType drt = createDefaultDescribeRecordType();
    List<QName> typeNames = new ArrayList<>();
    typeNames.add(new QName(CswConstants.CSW_OUTPUT_SCHEMA, VALID_TYPE, VALID_PREFIX));
    drt.setTypeName(typeNames);
    DescribeRecordResponseType drrt = null;
    try {
        drrt = csw.describeRecord(drt);
    } catch (CswException e) {
        fail("CswException caught during describeRecord POST request: " + e.getMessage());
    }
    assertThat(drrt, notNullValue());
    assertThat(drrt.getSchemaComponent(), notNullValue());
    List<SchemaComponentType> schemaComponents = drrt.getSchemaComponent();
    assertThat(schemaComponents.size(), is(1));
}
Also used : DescribeRecordType(net.opengis.cat.csw.v_2_0_2.DescribeRecordType) SchemaComponentType(net.opengis.cat.csw.v_2_0_2.SchemaComponentType) QName(javax.xml.namespace.QName) DescribeRecordResponseType(net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType) ArrayList(java.util.ArrayList) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Test(org.junit.Test)

Aggregations

DescribeRecordResponseType (net.opengis.cat.csw.v_2_0_2.DescribeRecordResponseType)36 Test (org.junit.Test)34 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)26 SchemaComponentType (net.opengis.cat.csw.v_2_0_2.SchemaComponentType)24 DescribeRecordRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.DescribeRecordRequest)20 ArrayList (java.util.ArrayList)14 QName (javax.xml.namespace.QName)12 DescribeRecordType (net.opengis.cat.csw.v_2_0_2.DescribeRecordType)12 StringWriter (java.io.StringWriter)2 JAXBContext (javax.xml.bind.JAXBContext)2 JAXBElement (javax.xml.bind.JAXBElement)2 JAXBException (javax.xml.bind.JAXBException)2 Marshaller (javax.xml.bind.Marshaller)2