use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method likeXPathInvalid.
@Test(expected = IllegalArgumentException.class)
public void likeXPathInvalid() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.xpath("foo").is().like().text("bar");
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method beyond.
@Test
public void beyond() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(Metacard.GEOGRAPHY).beyond().wkt(POINT_WKT, 123.45d);
filter.accept(visitor, null);
filter = builder.attribute(Metacard.GEOGRAPHY).beyond().wkt(POINT_WKT);
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(2)).visit(isA(Beyond.class), anyObject());
// TODO check arguments
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method notNull.
@Test
public void notNull() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.not(builder.attribute(FOO_ATTRIBUTE).is().empty());
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(Not.class), anyObject());
inOrder.verify(visitor).visit(isA(PropertyIsNull.class), anyObject());
}
use of org.opengis.filter.FilterVisitor in project ddf by codice.
the class FilterBuilderTest method likeFuzzy.
@Test
public void likeFuzzy() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(FOO_ATTRIBUTE).is().like().fuzzyText("bar");
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(1)).visit(isA(PropertyIsLike.class), anyObject());
// TODO check for fuzzy
}
use of org.opengis.filter.FilterVisitor 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());
}
Aggregations