use of org.geotools.filter.visitor.DefaultFilterVisitor 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());
}
use of org.geotools.filter.visitor.DefaultFilterVisitor in project ddf by codice.
the class FilterBuilderTest method within.
@Test
public void within() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(Metacard.GEOGRAPHY).within().wkt(POINT_WKT);
filter.accept(visitor, null);
filter = builder.attribute(Metacard.GEOGRAPHY).is().within().wkt(MULTIPOLYGON_WKT);
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(2)).visit(isA(Within.class), anyObject());
}
use of org.geotools.filter.visitor.DefaultFilterVisitor in project ddf by codice.
the class FilterBuilderTest method during.
@Test
public void during() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(FOO_ATTRIBUTE).during().dates(new Date(), new Date(System.currentTimeMillis() + 10000000));
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).during().next(1000);
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).during().last(1000);
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).is().during().dates(new Date(), new Date(System.currentTimeMillis() + 10000000));
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).is().during().next(1000);
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).is().during().last(1000);
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(6)).visit(isA(During.class), anyObject());
}
use of org.geotools.filter.visitor.DefaultFilterVisitor in project ddf by codice.
the class FilterBuilderTest method likeCaseSensitive.
@Test
public void likeCaseSensitive() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(FOO_ATTRIBUTE).is().like().caseSensitiveText("bAr");
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(PropertyIsLike.class), anyObject());
// TODO check case sensitivity
}
Aggregations