Search in sources :

Example 6 with GetRecordsRequest

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

the class CswQueryFactoryTest method createDefaultGetRecordsRequest.

/**
     * Creates default GetRecordsRequest GET request, with no sections specified
     *
     * @return Vanilla valid GetRecordsRequest object
     */
private GetRecordsRequest createDefaultGetRecordsRequest() {
    GetRecordsRequest grr = new GetRecordsRequest();
    grr.setService(CswConstants.CSW);
    grr.setVersion(CswConstants.VERSION_2_0_2);
    grr.setRequest(CswConstants.GET_RECORDS);
    grr.setNamespace(CswConstants.XMLNS_DEFINITION_PREFIX + CswConstants.CSW_NAMESPACE_PREFIX + CswConstants.EQUALS + CswConstants.CSW_OUTPUT_SCHEMA + CswConstants.XMLNS_DEFINITION_POSTFIX + CswConstants.COMMA + CswConstants.XMLNS_DEFINITION_PREFIX + CswConstants.OGC_NAMESPACE_PREFIX + CswConstants.EQUALS + CswConstants.OGC_SCHEMA + CswConstants.XMLNS_DEFINITION_POSTFIX + CswConstants.COMMA + CswConstants.XMLNS_DEFINITION_PREFIX + CswConstants.GML_NAMESPACE_PREFIX + CswConstants.EQUALS + CswConstants.GML_SCHEMA + CswConstants.XMLNS_DEFINITION_POSTFIX + CswConstants.COMMA);
    grr.setOutputSchema(CswConstants.CSW_OUTPUT_SCHEMA);
    grr.setOutputFormat(CswConstants.OUTPUT_FORMAT_XML);
    grr.setTypeNames(VALID_TYPES);
    return grr;
}
Also used : GetRecordsRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetRecordsRequest)

Example 7 with GetRecordsRequest

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

the class TestCswEndpoint method testGetRecordsNullRequest.

@Test(expected = CswException.class)
public void testGetRecordsNullRequest() throws CswException {
    GetRecordsRequest grr = null;
    csw.getRecords(grr);
}
Also used : GetRecordsRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetRecordsRequest) Test(org.junit.Test)

Example 8 with GetRecordsRequest

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

the class TestCswEndpoint method testGetRecordsNoVersion.

@Test
public void testGetRecordsNoVersion() throws CswException {
    GetRecordsRequest grr = createDefaultGetRecordsRequest();
    grr.setVersion(null);
    csw.getRecords(grr);
}
Also used : GetRecordsRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetRecordsRequest) Test(org.junit.Test)

Example 9 with GetRecordsRequest

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

the class TestCswEndpoint method testGetRecordsInvalidTypeNames.

@Test(expected = CswException.class)
public void testGetRecordsInvalidTypeNames() throws CswException {
    GetRecordsRequest grr = createDefaultGetRecordsRequest();
    grr.setTypeNames(BAD_TYPES);
    csw.getRecords(grr);
}
Also used : GetRecordsRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetRecordsRequest) Test(org.junit.Test)

Example 10 with GetRecordsRequest

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

the class TestCswEndpoint method createDefaultGetRecordsRequest.

/**
     * Creates default GetRecordsRequest GET request, with no sections specified
     *
     * @return Vanilla valid GetRecordsRequest object
     */
private GetRecordsRequest createDefaultGetRecordsRequest() {
    GetRecordsRequest grr = new GetRecordsRequest();
    grr.setService(CswConstants.CSW);
    grr.setVersion(CswConstants.VERSION_2_0_2);
    grr.setRequest(CswConstants.GET_RECORDS);
    grr.setNamespace(CswConstants.XMLNS_DEFINITION_PREFIX + CswConstants.CSW_NAMESPACE_PREFIX + CswConstants.EQUALS + CswConstants.CSW_OUTPUT_SCHEMA + CswConstants.XMLNS_DEFINITION_POSTFIX + CswConstants.COMMA + CswConstants.XMLNS_DEFINITION_PREFIX + CswConstants.OGC_NAMESPACE_PREFIX + CswConstants.EQUALS + CswConstants.OGC_SCHEMA + CswConstants.XMLNS_DEFINITION_POSTFIX + CswConstants.COMMA + CswConstants.XMLNS_DEFINITION_PREFIX + CswConstants.GML_NAMESPACE_PREFIX + CswConstants.EQUALS + CswConstants.GML_SCHEMA + CswConstants.XMLNS_DEFINITION_POSTFIX + CswConstants.COMMA);
    grr.setOutputSchema(CswConstants.CSW_OUTPUT_SCHEMA);
    grr.setOutputFormat(CswConstants.OUTPUT_FORMAT_XML);
    grr.setTypeNames(VALID_TYPES);
    return grr;
}
Also used : GetRecordsRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetRecordsRequest)

Aggregations

GetRecordsRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.GetRecordsRequest)13 Test (org.junit.Test)9 Subscription (ddf.catalog.event.Subscription)3 Dictionary (java.util.Dictionary)3 Response (javax.ws.rs.core.Response)3 AcknowledgementType (net.opengis.cat.csw.v_2_0_2.AcknowledgementType)3 CswSubscription (org.codice.ddf.spatial.ogc.csw.catalog.endpoint.event.CswSubscription)3 QueryImpl (ddf.catalog.operation.impl.QueryImpl)1 JAXBElement (javax.xml.bind.JAXBElement)1