use of org.geosdi.geoplatform.xml.ows.v100.DomainType 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 + "]");
}
use of org.geosdi.geoplatform.xml.ows.v100.DomainType in project ddf by codice.
the class CswEndpointTest 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 org.geosdi.geoplatform.xml.ows.v100.DomainType in project ddf by codice.
the class CswEndpointTest method verifyOperationsMetadata.
/**
* Helper method to verify the OperationsMetadata section matches the endpoint's definition
*
* @param ct The CapabilitiesType to verify
*/
private void verifyOperationsMetadata(CapabilitiesType ct) {
OperationsMetadata om = ct.getOperationsMetadata();
List<Operation> opList = om.getOperation();
ArrayList<String> opNames = new ArrayList<>();
for (Operation op : opList) {
opNames.add(op.getName());
if (StringUtils.equals(CswConstants.TRANSACTION, op.getName()) || StringUtils.equals(CswConstants.GET_RECORDS, op.getName())) {
for (DomainType parameter : op.getParameter()) {
if (StringUtils.equals(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER, parameter.getName())) {
assertThat(parameter.getValue(), contains(CswConstants.CONSTRAINT_LANGUAGE_FILTER, CswConstants.CONSTRAINT_LANGUAGE_CQL));
} else if (StringUtils.equals(CswConstants.TYPE_NAMES_PARAMETER, parameter.getName())) {
if (StringUtils.equals(op.getName(), CswConstants.TRANSACTION)) {
assertThat(parameter.getValue(), contains(CswConstants.CSW_RECORD));
} else {
assertThat(parameter.getValue(), hasItems(CswConstants.CSW_RECORD, THIRD_PARTY_TYPE_NAME));
}
}
}
}
}
assertThat(opNames.contains(CswConstants.GET_CAPABILITIES), is(true));
assertThat(opNames.contains(CswConstants.DESCRIBE_RECORD), is(true));
assertThat(opNames.contains(CswConstants.GET_RECORDS), is(true));
assertThat(opNames.contains(CswConstants.GET_RECORD_BY_ID), is(true));
assertThat(opNames.contains(CswConstants.TRANSACTION), is(true));
}
use of org.geosdi.geoplatform.xml.ows.v100.DomainType in project ddf by codice.
the class CswCqlFilterTest method getOperation.
private static Operation getOperation() {
List<DomainType> getRecordsParameters = new ArrayList<>(6);
DomainType typeName = new DomainType();
typeName.setName(CswConstants.TYPE_NAME_PARAMETER);
getRecordsParameters.add(typeName);
DomainType outputSchema = new DomainType();
outputSchema.setName(CswConstants.OUTPUT_SCHEMA_PARAMETER);
getRecordsParameters.add(outputSchema);
DomainType constraintLang = new DomainType();
constraintLang.setName(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER);
getRecordsParameters.add(constraintLang);
DomainType outputFormat = new DomainType();
outputFormat.setName(CswConstants.OUTPUT_FORMAT_PARAMETER);
getRecordsParameters.add(outputFormat);
DomainType resultType = new DomainType();
resultType.setName(CswConstants.RESULT_TYPE_PARAMETER);
getRecordsParameters.add(resultType);
DomainType elementSetName = new DomainType();
elementSetName.setName(CswConstants.ELEMENT_SET_NAME_PARAMETER);
getRecordsParameters.add(elementSetName);
Operation getRecords = new Operation();
getRecords.setName(CswConstants.GET_RECORDS);
getRecords.setParameter(getRecordsParameters);
List<Operation> operations = new ArrayList<>(1);
operations.add(getRecords);
return getRecords;
}
use of org.geosdi.geoplatform.xml.ows.v100.DomainType in project ddf by codice.
the class CswEndpoint method addOperationParameter.
private void addOperationParameter(String name, List<String> params, Operation op) {
DomainType dt = createDomainType(name, params);
op.getParameter().add(dt);
}
Aggregations