Search in sources :

Example 6 with FunctionExpression

use of org.geotools.filter.FunctionExpression in project sldeditor by robward-scisys.

the class FunctionManagerTest method testCreateExpression.

/**
 * Test method for
 * {@link com.sldeditor.filter.v2.function.FunctionManager#createExpression(org.opengis.filter.capability.FunctionName)}.
 */
@Test
public void testCreateExpression() {
    DefaultFunctionFactory functionFactory = new DefaultFunctionFactory();
    List<FunctionName> functionNameList = functionFactory.getFunctionNames();
    FunctionName functionName = null;
    Expression expression = FunctionManager.getInstance().createExpression(functionName);
    assertNull(expression);
    functionName = functionNameList.get(0);
    expression = FunctionManager.getInstance().createExpression(functionName);
    assertNotNull(expression);
    FunctionExpression funcExpression = (FunctionExpression) expression;
    assertTrue(functionName.getName().compareTo(funcExpression.getName()) == 0);
}
Also used : FunctionName(org.opengis.filter.capability.FunctionName) FunctionExpression(org.geotools.filter.FunctionExpression) DefaultFunctionFactory(org.geotools.filter.function.DefaultFunctionFactory) Expression(org.opengis.filter.expression.Expression) FunctionExpression(org.geotools.filter.FunctionExpression) Test(org.junit.Test)

Aggregations

FunctionExpression (org.geotools.filter.FunctionExpression)6 Expression (org.opengis.filter.expression.Expression)6 FunctionName (org.opengis.filter.capability.FunctionName)5 AttributeExpressionImpl (org.geotools.filter.AttributeExpressionImpl)3 LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)3 ArrayList (java.util.ArrayList)2 FunctionImpl (org.geotools.filter.FunctionImpl)2 MathExpressionImpl (org.geotools.filter.MathExpressionImpl)2 DefaultFunctionFactory (org.geotools.filter.function.DefaultFunctionFactory)2 Test (org.junit.Test)2 Parameter (org.opengis.parameter.Parameter)2 DataSourceAttributeData (com.sldeditor.datasource.attribute.DataSourceAttributeData)1 Geometry (com.vividsolutions.jts.geom.Geometry)1 LineString (com.vividsolutions.jts.geom.LineString)1 Point (com.vividsolutions.jts.geom.Point)1 ParseException (com.vividsolutions.jts.io.ParseException)1 List (java.util.List)1 ConstantExpression (org.geotools.filter.ConstantExpression)1 EnvFunction (org.geotools.filter.function.EnvFunction)1