use of net.opengis.cat.csw._3.CapabilitiesType 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);
}
use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.
the class TestCswEndpoint method testCapabilitiesFederatedCatalogs.
@Test
public void testCapabilitiesFederatedCatalogs() {
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());
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 + "]");
}
use of net.opengis.cat.csw._3.CapabilitiesType 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);
}
use of net.opengis.cat.csw._3.CapabilitiesType 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());
}
use of net.opengis.cat.csw._3.CapabilitiesType 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);
}
Aggregations