use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestWfsFilterDelegate method intersectsMultiple.
private void intersectsMultiple(boolean indexed) {
List<String> gmlProps = new ArrayList<>();
gmlProps.add(MOCK_GEOM);
gmlProps.add(MOCK_GEOM2);
when(mockFeatureMetacardType.getGmlProperties()).thenReturn(gmlProps);
for (String gmlProp : gmlProps) {
when(mockFeatureMetacardType.getAttributeDescriptor(gmlProp)).thenReturn(new FeatureAttributeDescriptor(gmlProp, gmlProp, indexed, false, false, false, BasicTypes.STRING_TYPE));
}
SpatialOperatorType operator = new SpatialOperatorType();
operator.setName(SPATIAL_OPERATORS.Intersects.toString());
FilterCapabilities capabilities = MockWfsServer.getFilterCapabilities();
capabilities.getSpatialCapabilities().getSpatialOperators().getSpatialOperator().clear();
capabilities.getSpatialCapabilities().getSpatialOperators().getSpatialOperator().add(operator);
WfsFilterDelegate delegate = new WfsFilterDelegate(mockFeatureMetacardType, capabilities, GeospatialUtil.EPSG_4326_URN, null, GeospatialUtil.LAT_LON_ORDER);
FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
if (indexed) {
assertNotNull(filter);
assertTrue(filter.isSetLogicOps());
assertNotNull(filter.getLogicOps());
} else {
assertNull(filter);
}
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestWfsFilterDelegate method testIsInFilterSequenceType.
@Test
public void testIsInFilterSequenceType() throws Exception {
setupMockMetacardType();
FilterType beforeFilter = setupBeforeFilterType();
FilterType afterFilter = setupAfterFilterType();
FilterType duringFilter = setupDuringFilterType();
WfsFilterDelegate afterDelegate = setupTemporalFilterDelegate();
WfsFilterDelegate beforeDelegate = setupTemporalFilterDelegate();
// Test is before filter type
assertThat(beforeDelegate.isBeforeFilter(beforeFilter), is(true));
assertThat(beforeDelegate.isBeforeFilter(afterFilter), is(false));
assertThat(beforeDelegate.isBeforeFilter(duringFilter), is(false));
// Test is during filter type
assertThat(afterDelegate.isDuringFilter(duringFilter), is(true));
assertThat(afterDelegate.isDuringFilter(beforeFilter), is(false));
assertThat(afterDelegate.isDuringFilter(afterFilter), is(false));
// Test is after filter type
assertThat(afterDelegate.isAfterFilter(afterFilter), is(true));
assertThat(afterDelegate.isAfterFilter(beforeFilter), is(false));
assertThat(afterDelegate.isAfterFilter(duringFilter), is(false));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestWfsFilterDelegate method testIntersectsAsBoundingBox.
@Test
public void testIntersectsAsBoundingBox() throws SAXException, IOException, JAXBException {
WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.BBOX.toString());
FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
assertNotNull(filter);
assertTrue(filter.getSpatialOps().getValue() instanceof BBOXType);
assertFalse(filter.isSetLogicOps());
assertXMLEqual(MockWfsServer.getBboxXmlFilter(), getXmlFromMarshaller(filter));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestWfsFilterDelegate method testLogicalNotNoLogicalSupport.
@Test(expected = UnsupportedOperationException.class)
public void testLogicalNotNoLogicalSupport() throws Exception {
WfsFilterDelegate delegate = makeDelegateForLogicalSupportTests();
FilterType filterToBeNoted = delegate.propertyIsLike(Metacard.ANY_TEXT, LITERAL, true);
//Perform Test
delegate.not(filterToBeNoted);
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestWfsFilterDelegate method testIntersectsAsNotDisjoint.
@Test
public void testIntersectsAsNotDisjoint() {
WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Disjoint.toString());
FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
assertTrue(filter.isSetLogicOps());
assertTrue(filter.getLogicOps().getValue() instanceof UnaryLogicOpType);
UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
assertTrue(type.isSetSpatialOps());
assertTrue(type.getSpatialOps().getValue() instanceof BinarySpatialOpType);
}
Aggregations