Search in sources :

Example 11 with GetCapabilitiesRequest

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

the class TestCswEndpoint method testCapabilitiesFederatedCatalogs.

@Test
public void testCapabilitiesFederatedCatalogs() {
    GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gcr);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    assertThat(ct.getOperationsMetadata(), notNullValue());
    for (Operation operation : ct.getOperationsMetadata().getOperation()) {
        if (StringUtils.equals(operation.getName(), CswConstants.GET_RECORDS)) {
            for (DomainType constraint : operation.getConstraint()) {
                if (StringUtils.equals(constraint.getName(), CswConstants.FEDERATED_CATALOGS)) {
                    assertThat(constraint.getValue().size(), is(3));
                    return;
                }
            }
        }
    }
    fail("Didn't find [" + CswConstants.FEDERATED_CATALOGS + "] in request [" + CswConstants.GET_RECORDS + "]");
}
Also used : GetCapabilitiesRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest) DomainType(net.opengis.ows.v_1_0_0.DomainType) CapabilitiesType(net.opengis.cat.csw.v_2_0_2.CapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Operation(net.opengis.ows.v_1_0_0.Operation) Test(org.junit.Test)

Aggregations

GetCapabilitiesRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest)11 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)10 GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)10 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)10 Test (org.junit.Test)9 ResourceNotFoundException (ddf.catalog.resource.ResourceNotFoundException)1 ResourceNotSupportedException (ddf.catalog.resource.ResourceNotSupportedException)1 UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)1 CatalogTransformerException (ddf.catalog.transform.CatalogTransformerException)1 Subject (ddf.security.Subject)1 IOException (java.io.IOException)1 ConnectException (java.net.ConnectException)1 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 JAXBException (javax.xml.bind.JAXBException)1 SpatialCapabilitiesType (net.opengis.filter.v_1_1_0.SpatialCapabilitiesType)1 DomainType (net.opengis.ows.v_1_0_0.DomainType)1 Operation (net.opengis.ows.v_1_0_0.Operation)1 Csw (org.codice.ddf.spatial.ogc.csw.catalog.common.Csw)1 InvalidSyntaxException (org.osgi.framework.InvalidSyntaxException)1