use of net.opengis.filter.v_2_0_0.FilterCapabilities in project ddf by codice.
the class TestWfsFilterDelegate method testNoConformance.
@Test
public void testNoConformance() {
FilterCapabilities capabilities = MockWfsServer.getFilterCapabilities();
capabilities.setConformance(null);
WfsFilterDelegate delegate = new WfsFilterDelegate(mockFeatureMetacardType, capabilities, GeospatialUtil.EPSG_4326_URN, null, GeospatialUtil.LAT_LON_ORDER);
assertThat(delegate.isLogicalOps(), is(true));
assertThat(delegate.isEpsg4326(), is(true));
assertThat(delegate.isSortingSupported(), is(false));
assertThat(delegate.getSrsName(), is(GeospatialUtil.EPSG_4326_URN));
assertThat(delegate.getComparisonOps().size(), is(COMPARISON_OPERATORS.values().length));
assertThat(delegate.getGeometryOperands().size(), greaterThan(0));
assertThat(delegate.getSpatialOps().size(), is(SPATIAL_OPERATORS.values().length));
assertThat(delegate.getTemporalOps().size(), is(TEMPORAL_OPERATORS.values().length));
assertThat(delegate.getTemporalOperands().size(), greaterThan(0));
}
use of net.opengis.filter.v_2_0_0.FilterCapabilities in project ddf by codice.
the class TestWfsFilterDelegate method testConformanceAllowedValues.
@Test
public void testConformanceAllowedValues() {
// Setup
FilterCapabilities capabilities = MockWfsServer.getFilterCapabilities();
ConformanceType conformance = capabilities.getConformance();
List<DomainType> domainTypes = conformance.getConstraint();
for (DomainType domainType : domainTypes) {
if (StringUtils.equals(domainType.getName(), "ImplementsSorting")) {
domainType.setNoValues(null);
ValueType asc = new ValueType();
asc.setValue("ASC");
ValueType desc = new ValueType();
desc.setValue("DESC");
AllowedValues allowedValues = new AllowedValues();
List<Object> values = new ArrayList<>();
values.add(asc);
values.add(desc);
allowedValues.setValueOrRange(values);
domainType.setAllowedValues(allowedValues);
ValueType defaultValue = new ValueType();
defaultValue.setValue("ASC");
domainType.setDefaultValue(defaultValue);
break;
}
}
// Perform Test
WfsFilterDelegate delegate = new WfsFilterDelegate(mockFeatureMetacardType, capabilities, GeospatialUtil.EPSG_4326_URN, null, GeospatialUtil.LAT_LON_ORDER);
// Verify
assertThat(delegate.isSortingSupported(), is(true));
assertThat(delegate.getAllowedSortOrders().size(), is(2));
assertThat(delegate.getAllowedSortOrders().contains(SortOrder.ASCENDING), is(true));
assertThat(delegate.getAllowedSortOrders().contains(SortOrder.DESCENDING), is(true));
}
use of net.opengis.filter.v_2_0_0.FilterCapabilities in project ddf by codice.
the class TestWfsFilterDelegate method setupFilterDelegate.
private WfsFilterDelegate setupFilterDelegate(String spatialOpType) {
List<String> gmlProps = new ArrayList<>();
gmlProps.add(MOCK_GEOM);
when(mockFeatureMetacardType.getGmlProperties()).thenReturn(gmlProps);
when(mockFeatureMetacardType.getAttributeDescriptor(MOCK_GEOM)).thenReturn(new FeatureAttributeDescriptor(MOCK_GEOM, MOCK_GEOM, true, false, false, false, BasicTypes.STRING_TYPE));
SpatialOperatorType operator = new SpatialOperatorType();
operator.setName(spatialOpType);
FilterCapabilities capabilities = MockWfsServer.getFilterCapabilities();
capabilities.getSpatialCapabilities().getSpatialOperators().getSpatialOperator().clear();
capabilities.getSpatialCapabilities().getSpatialOperators().getSpatialOperator().add(operator);
return new WfsFilterDelegate(mockFeatureMetacardType, capabilities, GeospatialUtil.EPSG_4326_URN, null, GeospatialUtil.LAT_LON_ORDER);
}
use of net.opengis.filter.v_2_0_0.FilterCapabilities in project ddf by codice.
the class TestWfsFilterDelegate method setupFilterCapabilities.
private FilterCapabilities setupFilterCapabilities() {
FilterCapabilities filterCapabilities = new FilterCapabilities();
TemporalCapabilitiesType temporal = new TemporalCapabilitiesType();
temporal.setTemporalOperators(new TemporalOperatorsType());
TemporalOperatorType duringOperator = new TemporalOperatorType();
duringOperator.setName(TEMPORAL_OPERATORS.During.name());
temporal.getTemporalOperators().getTemporalOperator().add(duringOperator);
TemporalOperandsType temporalOperands = new TemporalOperandsType();
List<QName> timeQNames = Arrays.asList(new QName(Wfs20Constants.GML_3_2_NAMESPACE, "TimePeriod"), new QName(Wfs20Constants.GML_3_2_NAMESPACE, "TimeInstant"));
for (QName qName : timeQNames) {
TemporalOperandsType.TemporalOperand operand = new TemporalOperandsType.TemporalOperand();
operand.setName(qName);
temporalOperands.getTemporalOperand().add(operand);
}
temporal.setTemporalOperands(temporalOperands);
filterCapabilities.setTemporalCapabilities(temporal);
return filterCapabilities;
}
use of net.opengis.filter.v_2_0_0.FilterCapabilities in project ddf by codice.
the class TestWfsFilterDelegate method testNoComparisonOps.
@Test
public void testNoComparisonOps() {
FilterCapabilities capabilities = MockWfsServer.getFilterCapabilities();
capabilities.setScalarCapabilities(null);
WfsFilterDelegate delegate = new WfsFilterDelegate(mockFeatureMetacardType, capabilities, GeospatialUtil.EPSG_4326_URN, null, GeospatialUtil.LAT_LON_ORDER);
assertThat(delegate.isLogicalOps(), is(false));
assertThat(delegate.isEpsg4326(), is(true));
assertThat(delegate.isSortingSupported(), is(true));
assertThat(delegate.getSrsName(), is(GeospatialUtil.EPSG_4326_URN));
assertThat(delegate.getComparisonOps().size(), is(0));
assertThat(delegate.getGeometryOperands().size(), greaterThan(0));
assertThat(delegate.getSpatialOps().size(), is(SPATIAL_OPERATORS.values().length));
assertThat(delegate.getTemporalOps().size(), is(TEMPORAL_OPERATORS.values().length));
assertThat(delegate.getTemporalOperands().size(), greaterThan(0));
}
Aggregations