use of org.geotools.filter.temporal.TOverlapsImpl in project ddf by codice.
the class OpenSearchFilterVisitorTest method testOverlaps.
@Test
public void testOverlaps() {
During duringFilter = (During) geotoolsFilterBuilder.attribute(TEMPORAL_ATTRIBUTE_NAME).during().dates(START_DATE, END_DATE);
TOverlaps overlapsFilter = new TOverlapsImpl(duringFilter.getExpression1(), duringFilter.getExpression2());
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.AND);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(overlapsFilter, openSearchFilterVisitorObject);
assertThat(result.getTemporalSearch(), allOf(is(notNullValue()), hasProperty("startDate", is(START_DATE)), hasProperty("endDate", is(END_DATE))));
}
use of org.geotools.filter.temporal.TOverlapsImpl in project ddf by codice.
the class OpenSearchFilterVisitorTest method testOverlapsOrNest.
@Test
public void testOverlapsOrNest() {
During duringFilter = (During) geotoolsFilterBuilder.attribute(TEMPORAL_ATTRIBUTE_NAME).during().dates(START_DATE, END_DATE);
TOverlaps overlapsFilter = new TOverlapsImpl(duringFilter.getExpression1(), duringFilter.getExpression2());
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.OR);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(overlapsFilter, openSearchFilterVisitorObject);
assertThat(result.getTemporalSearch(), is(nullValue()));
}
use of org.geotools.filter.temporal.TOverlapsImpl in project ddf by codice.
the class OpenSearchFilterVisitorTest method testOverlapsNullNest.
@Test
public void testOverlapsNullNest() {
During duringFilter = (During) geotoolsFilterBuilder.attribute(TEMPORAL_ATTRIBUTE_NAME).during().dates(START_DATE, END_DATE);
TOverlaps overlapsFilter = new TOverlapsImpl(duringFilter.getExpression1(), duringFilter.getExpression2());
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(overlapsFilter, openSearchFilterVisitorObject);
assertThat(result.getTemporalSearch(), allOf(is(notNullValue()), hasProperty("startDate", is(START_DATE)), hasProperty("endDate", is(END_DATE))));
}
use of org.geotools.filter.temporal.TOverlapsImpl in project ddf by codice.
the class OpenSearchFilterVisitorTest method testOverlapsInstant.
@Test
public void testOverlapsInstant() {
After afterFilter = (After) geotoolsFilterBuilder.attribute(TEMPORAL_ATTRIBUTE_NAME).after().date(START_DATE);
TOverlaps overlapsFilter = new TOverlapsImpl(afterFilter.getExpression1(), afterFilter.getExpression2());
OpenSearchFilterVisitorObject openSearchFilterVisitorObject = new OpenSearchFilterVisitorObject();
openSearchFilterVisitorObject.setCurrentNest(NestedTypes.AND);
OpenSearchFilterVisitorObject result = (OpenSearchFilterVisitorObject) openSearchFilterVisitor.visit(overlapsFilter, openSearchFilterVisitorObject);
assertThat(result.getTemporalSearch(), allOf(is(notNullValue()), hasProperty("startDate", is(START_DATE)), hasProperty("endDate", is(START_DATE))));
}
Aggregations