use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest method testCapabilitiesRequestBadSection.
@Test
public void testCapabilitiesRequestBadSection() {
// Shouldn't return any sections
GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
gcr.setSections("bad");
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 net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest 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 net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class AbstractCswSource method getCapabilities.
protected CapabilitiesType getCapabilities() {
CapabilitiesType caps = null;
Subject subject = getSystemSubject();
Csw csw = factory.getClientForSystemSubject(subject);
try {
LOGGER.debug("Doing getCapabilities() call for CSW");
GetCapabilitiesRequest request = new GetCapabilitiesRequest(CswConstants.CSW);
request.setAcceptVersions(CswConstants.VERSION_2_0_2 + "," + CswConstants.VERSION_2_0_1);
caps = csw.getCapabilities(request);
} catch (CswException cswe) {
LOGGER.info(CSW_SERVER_ERROR + " Received HTTP code '{}' from server for source with id='{}'. Set Logging to DEBUG for details.", cswe.getHttpStatus(), cswSourceConfiguration.getId());
LOGGER.debug(CSW_SERVER_ERROR, cswe);
} catch (WebApplicationException wae) {
LOGGER.debug(handleWebApplicationException(wae), wae);
} catch (Exception ce) {
handleClientException(ce);
}
return caps;
}
use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest 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);
}
use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class CswEndpointTest 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);
}
Aggregations