use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeBadSection.
@Test
public void testGetCapabilitiesTypeBadSection() {
// Shouldn't return any sections
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList("bad"));
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.getServiceIdentification(), nullValue());
assertThat(ct.getServiceProvider(), nullValue());
assertThat(ct.getOperationsMetadata(), nullValue());
}
use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class TestCswEndpoint 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 TestCswEndpoint method testGetCapabilitiesTypeServiceIdentification.
@Test
public void testGetCapabilitiesTypeServiceIdentification() {
// Should only return the ServiceIdentification section
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
SectionsType stv = new SectionsType();
stv.setSection(Arrays.asList(CswEndpoint.SERVICE_IDENTIFICATION));
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());
verifyServiceIdentification(ct);
verifyFilterCapabilities(ct);
assertThat(ct.getServiceProvider(), nullValue());
assertThat(ct.getOperationsMetadata(), nullValue());
}
use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class TestCswEndpoint method testCapabilitiesRequestServiceIdentification.
@Test
public void testCapabilitiesRequestServiceIdentification() {
// Should only return the ServiceIdentification section
GetCapabilitiesRequest gcr = createDefaultGetCapabilitiesRequest();
gcr.setSections(CswEndpoint.SERVICE_IDENTIFICATION);
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());
verifyFilterCapabilities(ct);
assertThat(ct.getServiceProvider(), nullValue());
verifyServiceIdentification(ct);
}
use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class TestCswEndpoint method testGetCapabilitiesTypeFederatedCatalogs.
@Test
public void testGetCapabilitiesTypeFederatedCatalogs() {
GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
CapabilitiesType ct = null;
try {
ct = csw.getCapabilities(gct);
} 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 + "]");
}
Aggregations