use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method intersects.
@Test
public void intersects() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(Metacard.GEOGRAPHY).intersecting().wkt(POINT_WKT);
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(Intersects.class), anyObject());
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method isDate.
@Test
public void isDate() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(FOO_ATTRIBUTE).is().date(new Date());
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(PropertyIsEqualTo.class), anyObject());
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method withinBuffer.
@Test
public void withinBuffer() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(Metacard.GEOGRAPHY).withinBuffer().wkt(POINT_WKT);
filter.accept(visitor, null);
filter = builder.attribute(Metacard.GEOGRAPHY).withinBuffer().wkt(POINT_WKT, 123.45d);
filter.accept(visitor, null);
filter = builder.attribute(Metacard.GEOGRAPHY).is().withinBuffer().wkt(POINT_WKT);
filter.accept(visitor, null);
filter = builder.attribute(Metacard.GEOGRAPHY).is().withinBuffer().wkt(POINT_WKT, 123.45d);
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(4)).visit(isA(DWithin.class), anyObject());
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method xpathExists.
@Test
public void xpathExists() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.xpath("//foo").exists();
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(PropertyIsLike.class), anyObject());
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method before.
@Test
public void before() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(FOO_ATTRIBUTE).before().date(new Date());
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).is().before().date(new Date());
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(2)).visit(isA(Before.class), anyObject());
}
Aggregations