Search in sources :

Example 6 with GetCapabilitiesRequest

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

the class TestCswEndpoint method testCapabilitiesRequestNoSections.

@Test
public void testCapabilitiesRequestNoSections() {
    // Should return all sections
    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());
    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 7 with GetCapabilitiesRequest

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

the class TestCswEndpoint method testCapabilitiesRequestNoVersion.

@Test
public void testCapabilitiesRequestNoVersion() {
    // Should return all sections
    GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
    gcr.setAcceptVersions(null);
    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 8 with GetCapabilitiesRequest

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

the class TestCswEndpoint method testCapabilitiesRequestFilterCapabilities.

@Test
public void testCapabilitiesRequestFilterCapabilities() {
    // Should only return the Filter_Capabilities section
    GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
    gcr.setSections(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());
    assertThat(ct.getOperationsMetadata(), nullValue());
    assertThat(ct.getServiceIdentification(), nullValue());
    assertThat(ct.getServiceProvider(), nullValue());
    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 9 with GetCapabilitiesRequest

use of org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest 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 10 with GetCapabilitiesRequest

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

the class TestCswEndpoint method testCapabilitiesRequestServiceProvider.

@Test
public void testCapabilitiesRequestServiceProvider() {
    // Should only return the ServiceProvider section
    GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
    gcr.setSections(CswEndpoint.SERVICE_PROVIDER);
    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(), nullValue());
    assertThat(ct.getServiceIdentification(), nullValue());
    verifyFilterCapabilities(ct);
    verifyServiceProvider(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)

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