Search in sources :

Example 26 with Literal

use of org.opengis.filter.expression.Literal in project ddf by codice.

the class TestCswRecordMapperFilterVisitor method testLiteralWithNoType.

@Test
public void testLiteralWithNoType() {
    Date date = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
    String dateString = formatter.format(date);
    Literal val = factory.literal(dateString);
    Literal literal = (Literal) visitor.visit(val, null);
    assertThat(literal.getValue(), instanceOf(String.class));
    assertThat(literal.getValue(), is(dateString));
}
Also used : Literal(org.opengis.filter.expression.Literal) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) CswQueryFactoryTest(org.codice.ddf.spatial.ogc.csw.catalog.endpoint.CswQueryFactoryTest) Test(org.junit.Test)

Aggregations

Literal (org.opengis.filter.expression.Literal)26 Date (java.util.Date)14 Test (org.junit.Test)9 Filter (org.opengis.filter.Filter)9 SurfaceImpl (org.geotools.geometry.jts.spatialschema.geometry.primitive.SurfaceImpl)6 Coordinate (com.vividsolutions.jts.geom.Coordinate)5 TemporalFilter (ddf.catalog.impl.filter.TemporalFilter)5 Expression (org.opengis.filter.expression.Expression)5 AttributeType (ddf.catalog.data.AttributeType)4 FilterDelegate (ddf.catalog.filter.FilterDelegate)4 PropertyIsEqualToLiteral (ddf.catalog.filter.impl.PropertyIsEqualToLiteral)4 CswQueryFactoryTest (org.codice.ddf.spatial.ogc.csw.catalog.endpoint.CswQueryFactoryTest)4 LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)4 ExcludeFilter (org.opengis.filter.ExcludeFilter)4 IncludeFilter (org.opengis.filter.IncludeFilter)4 Point (com.vividsolutions.jts.geom.Point)3 SimpleDateFormat (java.text.SimpleDateFormat)3 HashMap (java.util.HashMap)3 BBoxSpatialFilter (org.codice.ddf.opensearch.query.filter.BBoxSpatialFilter)3 PolygonSpatialFilter (org.codice.ddf.opensearch.query.filter.PolygonSpatialFilter)3