Search in sources :

Example 1 with PropertyIsGreaterThanOrEqualTo

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

the class TestCswRecordMapperFilterVisitor method testVisitPropertyIsGreaterThanOrEqualTo.

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

Example 2 with PropertyIsGreaterThanOrEqualTo

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

the class TestCswRecordMapperFilterVisitor method testVisitPropertyIsGreaterThanOrEqualToTemporal.

@Ignore("not supported by solr provider")
@Test
public void testVisitPropertyIsGreaterThanOrEqualToTemporal() {
    Expression val = factory.literal(new Date());
    PropertyIsGreaterThanOrEqualTo filter = factory.greaterOrEqual(created, val);
    Object obj = visitor.visit(filter, null);
    assertThat(obj, instanceOf(Or.class));
    Or duplicate = (Or) obj;
    for (Filter child : duplicate.getChildren()) {
        BinaryTemporalOperator binary = (BinaryTemporalOperator) child;
        assertThat(binary, anyOf(instanceOf(TEquals.class), instanceOf(After.class)));
        assertThat(binary.getExpression1(), is(created));
        assertThat(binary.getExpression2(), is(val));
    }
}
Also used : PropertyIsGreaterThanOrEqualTo(org.opengis.filter.PropertyIsGreaterThanOrEqualTo) BinaryTemporalOperator(org.opengis.filter.temporal.BinaryTemporalOperator) Or(org.opengis.filter.Or) Expression(org.opengis.filter.expression.Expression) Filter(org.opengis.filter.Filter) Date(java.util.Date) Ignore(org.junit.Ignore) 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 PropertyIsGreaterThanOrEqualTo (org.opengis.filter.PropertyIsGreaterThanOrEqualTo)2 Expression (org.opengis.filter.expression.Expression)2 Date (java.util.Date)1 Ignore (org.junit.Ignore)1 Filter (org.opengis.filter.Filter)1 Or (org.opengis.filter.Or)1 BinaryTemporalOperator (org.opengis.filter.temporal.BinaryTemporalOperator)1