Search in sources :

Example 1 with PropertyIsLessThan

use of org.opengis.filter.PropertyIsLessThan in project ddf by codice.

the class TestCswRecordMapperFilterVisitor method testVisitPropertyIsLessThanTemporal.

@Test
public void testVisitPropertyIsLessThanTemporal() {
    Expression val = factory.literal(new Date());
    PropertyIsLessThan filter = factory.less(created, val);
    Object obj = visitor.visit(filter, null);
    assertThat(obj, instanceOf(Before.class));
    Before duplicate = (Before) obj;
    assertThat(duplicate.getExpression1(), is(created));
    assertThat(duplicate.getExpression2(), is(val));
}
Also used : Before(org.opengis.filter.temporal.Before) Expression(org.opengis.filter.expression.Expression) PropertyIsLessThan(org.opengis.filter.PropertyIsLessThan) Date(java.util.Date) CswQueryFactoryTest(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.CswQueryFactoryTest) Test(org.junit.Test)

Example 2 with PropertyIsLessThan

use of org.opengis.filter.PropertyIsLessThan in project ddf by codice.

the class TestCswRecordMapperFilterVisitor method testVisitPropertyIsLessThan.

@Test
public void testVisitPropertyIsLessThan() {
    Expression val = factory.literal(8);
    PropertyIsLessThan filter = factory.less(attrExpr, val);
    Object obj = visitor.visit(filter, null);
    assertThat(obj, instanceOf(PropertyIsLessThan.class));
    PropertyIsLessThan duplicate = (PropertyIsLessThan) obj;
    assertThat(duplicate.getExpression1(), is(attrExpr));
    assertThat(duplicate.getExpression2(), is(val));
}
Also used : Expression(org.opengis.filter.expression.Expression) PropertyIsLessThan(org.opengis.filter.PropertyIsLessThan) CswQueryFactoryTest(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.CswQueryFactoryTest) Test(org.junit.Test)

Aggregations

CswQueryFactoryTest (org.codice.ddf.spatial.ogc.csw.catalog.endpoint.CswQueryFactoryTest)2 Test (org.junit.Test)2 PropertyIsLessThan (org.opengis.filter.PropertyIsLessThan)2 Expression (org.opengis.filter.expression.Expression)2 Date (java.util.Date)1 Before (org.opengis.filter.temporal.Before)1