use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeAllSections.
@Test
public void testGetCapabilitiesTypeAllSections() {
// Should return all sections
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.SERVICE_IDENTIFICATION, CswEndpoint.SERVICE_PROVIDER, CswEndpoint.OPERATIONS_METADATA, CswEndpoint.FILTER_CAPABILITIES));
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);
verifyServiceIdentification(ct);
verifyServiceProvider(ct);
verifyFilterCapabilities(ct);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException 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);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException 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);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException 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);
}
use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswException in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeFilterCapabilities.
@Test
public void testGetCapabilitiesTypeFilterCapabilities() {
// Should only return the Filter_Capabilities section
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.FILTER_CAPABILITIES));
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());
verifyFilterCapabilities(ct);
assertThat(ct.getOperationsMetadata(), nullValue());
assertThat(ct.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
}
Aggregations