Search in sources :

Example 6 with GetCapabilitiesType

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

the class TestCswEndpoint method testGetCapabilitiesTypeNoVersion.

@Test
public void testGetCapabilitiesTypeNoVersion() {
    // Should return all sections
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    gct.setAcceptVersions(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 7 with GetCapabilitiesType

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

the class TestCswEndpoint method testGetCapabilitiesTypeServiceProvider.

@Test
public void testGetCapabilitiesTypeServiceProvider() {
    // Should only return the ServiceProvider section
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    SectionsType stv = new SectionsType();
    stv.setSection(Arrays.asList(CswEndpoint.SERVICE_PROVIDER));
    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());
    verifyServiceProvider(ct);
    verifyFilterCapabilities(ct);
    assertThat(ct.getServiceIdentification(), nullValue());
    assertThat(ct.getOperationsMetadata(), 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 8 with GetCapabilitiesType

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

the class TestCswEndpoint method createDefaultGetCapabilitiesType.

/**
     * Creates default GetCapabilities POST request, with no sections specified
     *
     * @return Vanilla GetCapabilitiesType object
     */
private GetCapabilitiesType createDefaultGetCapabilitiesType() {
    GetCapabilitiesType gct = new GetCapabilitiesType();
    gct.setService(CswConstants.CSW);
    AcceptVersionsType avt = new AcceptVersionsType();
    avt.setVersion(CswEndpoint.SERVICE_TYPE_VERSION);
    gct.setAcceptVersions(avt);
    return gct;
}
Also used : GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) AcceptVersionsType(net.opengis.ows.v_1_0_0.AcceptVersionsType)

Example 9 with GetCapabilitiesType

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

the class TestCswEndpoint 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 10 with GetCapabilitiesType

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

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

Aggregations

GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)10 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)9 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)9 Test (org.junit.Test)9 SectionsType (net.opengis.ows.v_1_0_0.SectionsType)6 AcceptVersionsType (net.opengis.ows.v_1_0_0.AcceptVersionsType)1 DomainType (net.opengis.ows.v_1_0_0.DomainType)1 Operation (net.opengis.ows.v_1_0_0.Operation)1