use of org.geotools.filter.visitor.DefaultFilterVisitor in project ddf by codice.
the class FilterBuilderTest method orNull.
@Test
public void orNull() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.anyOf(builder.attribute(FOO_ATTRIBUTE).is().empty());
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(Or.class), anyObject());
inOrder.verify(visitor).visit(isA(PropertyIsNull.class), anyObject());
}
use of org.geotools.filter.visitor.DefaultFilterVisitor 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.geotools.filter.visitor.DefaultFilterVisitor 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.geotools.filter.visitor.DefaultFilterVisitor 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.geotools.filter.visitor.DefaultFilterVisitor 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());
}
Aggregations