Search in sources :

Example 16 with CapabilitiesType

use of org.geotoolkit.wcs.xml.v200.CapabilitiesType in project ddf by codice.

the class TestCswEndpoint method testCapabilitiesRequestAllSections.

@Test
public void testCapabilitiesRequestAllSections() {
    // Should return all sections
    GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
    gcr.setSections(CswEndpoint.SERVICE_IDENTIFICATION + "," + CswEndpoint.SERVICE_PROVIDER + "," + CswEndpoint.OPERATIONS_METADATA + "," + CswEndpoint.FILTER_CAPABILITIES);
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gcr);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    verifyOperationsMetadata(ct);
    verifyServiceIdentification(ct);
    verifyServiceProvider(ct);
    verifyFilterCapabilities(ct);
}
Also used : GetCapabilitiesRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest) 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) Test(org.junit.Test)

Example 17 with CapabilitiesType

use of org.geotoolkit.wcs.xml.v200.CapabilitiesType in project ddf by codice.

the class CswEndpointTest 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)

Example 18 with CapabilitiesType

use of org.geotoolkit.wcs.xml.v200.CapabilitiesType in project ddf by codice.

the class CswEndpointTest method testGetCapabilitiesTypeOperationsMetadata.

@Test
public void testGetCapabilitiesTypeOperationsMetadata() {
    // Should only return the OperationsMetadata section
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    SectionsType stv = new SectionsType();
    stv.setSection(Arrays.asList(CswEndpoint.OPERATIONS_METADATA));
    gct.setSections(stv);
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gct);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    verifyOperationsMetadata(ct);
    verifyFilterCapabilities(ct);
    assertThat(ct.getServiceIdentification(), nullValue());
    assertThat(ct.getServiceProvider(), nullValue());
}
Also used : SectionsType(net.opengis.ows.v_1_0_0.SectionsType) CapabilitiesType(net.opengis.cat.csw.v_2_0_2.CapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Test(org.junit.Test)

Example 19 with CapabilitiesType

use of org.geotoolkit.wcs.xml.v200.CapabilitiesType in project ddf by codice.

the class CswEndpointTest method testGetCapabilitiesTypeNoSections.

@Test
public void testGetCapabilitiesTypeNoSections() {
    // Should return all sections
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    gct.setSections(null);
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gct);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    verifyOperationsMetadata(ct);
    verifyServiceIdentification(ct);
    verifyServiceProvider(ct);
    verifyFilterCapabilities(ct);
}
Also used : CapabilitiesType(net.opengis.cat.csw.v_2_0_2.CapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Test(org.junit.Test)

Example 20 with CapabilitiesType

use of org.geotoolkit.wcs.xml.v200.CapabilitiesType in project ddf by codice.

the class CswSourceTest method testCswSourceNoFilterCapabilities.

@Test(expected = UnsupportedQueryException.class)
public void testCswSourceNoFilterCapabilities() throws CswException, UnsupportedQueryException, SecurityServiceException {
    // Setup
    CapabilitiesType mockCapabilitiesType = mock(CapabilitiesType.class);
    when(mockCsw.getCapabilities(any(GetCapabilitiesRequest.class))).thenReturn(mockCapabilitiesType);
    AbstractCswSource cswSource = getCswSource(mockCsw, mockContext);
    cswSource.setCswUrl(URL);
    cswSource.setId(ID);
    QueryImpl propertyIsLikeQuery = new QueryImpl(builder.attribute(Metacard.ANY_TEXT).is().like().text("junk"));
    propertyIsLikeQuery.setPageSize(10);
    cswSource.query(getQueryRequestWithSubject(propertyIsLikeQuery));
}
Also used : GetCapabilitiesRequest(org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest) QueryImpl(ddf.catalog.operation.impl.QueryImpl) CapabilitiesType(net.opengis.cat.csw.v_2_0_2.CapabilitiesType) Test(org.junit.Test)

Aggregations

CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)45 Test (org.junit.Test)44 GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)40 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)38 GetCapabilitiesRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest)24 SectionsType (net.opengis.ows.v_1_0_0.SectionsType)12 CapabilitiesType (com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType)6 DomainType (net.opengis.ows.v_1_0_0.DomainType)5 Operation (net.opengis.ows.v_1_0_0.Operation)5 CapabilitiesType (org.geosdi.geoplatform.xml.csw.v202.CapabilitiesType)5 CachingMetadataType (com.evolveum.midpoint.xml.ns._public.common.common_3.CachingMetadataType)4 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)4 ScalarCapabilitiesType (net.opengis.filter.v_1_1_0.ScalarCapabilitiesType)4 Test (org.testng.annotations.Test)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 CapabilityCollectionType (com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilityCollectionType)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ResourceSchema (com.evolveum.midpoint.schema.processor.ResourceSchema)2 ActivationCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ActivationCapabilityType)2 Metacard (ddf.catalog.data.Metacard)2