use of ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder in project ddf by codice.
the class FilterBuilderTest method operatorAfterNull.
@Test(expected = IllegalArgumentException.class)
public void operatorAfterNull() {
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute("something").after().date(null);
}
use of ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder 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 ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder 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 ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder 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 ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder 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());
}
Aggregations