Search in sources :

Example 21 with FunctionName

use of org.opengis.filter.capability.FunctionName 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

FunctionName (org.opengis.filter.capability.FunctionName)21 Test (org.junit.Test)12 ArrayList (java.util.ArrayList)9 Expression (org.opengis.filter.expression.Expression)7 DefaultFunctionFactory (org.geotools.filter.function.DefaultFunctionFactory)6 FunctionNameFilterInterface (com.sldeditor.filter.v2.function.namefilter.FunctionNameFilterInterface)5 FunctionExpression (org.geotools.filter.FunctionExpression)5 FunctionNameFilterAll (com.sldeditor.filter.v2.function.namefilter.FunctionNameFilterAll)4 ProcessFunctionFactory (org.geotools.process.function.ProcessFunctionFactory)4 FieldConfigString (com.sldeditor.ui.detail.config.FieldConfigString)3 AttributeExpressionImpl (org.geotools.filter.AttributeExpressionImpl)3 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)2 FunctionNameFilterRaster (com.sldeditor.filter.v2.function.namefilter.FunctionNameFilterRaster)2 BuiltInProcessFunction (com.sldeditor.rendertransformation.BuiltInProcessFunction)2 ProcessFunctionParameterValue (com.sldeditor.rendertransformation.ProcessFunctionParameterValue)2 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)2 LineString (com.vividsolutions.jts.geom.LineString)2 Point (com.vividsolutions.jts.geom.Point)2 FunctionImpl (org.geotools.filter.FunctionImpl)2 LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)2