Search in sources :

Example 1 with IsLikeExtended

use of com.sldeditor.filter.v2.function.misc.IsLike.IsLikeExtended in project sldeditor by robward-scisys.

the class MiscTests method testIsLikeClass.

/**
 * {@link com.sldeditor.filter.v2.function.misc.IsLike}.
 */
@Test
public void testIsLikeClass() {
    FilterConfigInterface objUnderTest = new IsLike();
    assertNotNull(objUnderTest.getFilterConfiguration());
    assertNotNull(objUnderTest.createFilter());
    assertNull(objUnderTest.createLogicFilter(null));
    IsLikeExtended filter = (IsLikeExtended) objUnderTest.createFilter(null);
    assertNull(filter.getLiteral());
    assertNull(filter.getExpression());
    List<Expression> parameterList = new ArrayList<Expression>();
    try {
        parameterList.add(ff.literal(CQL.toFilter("expr1 >= 5")));
    } catch (CQLException e) {
        e.printStackTrace();
        fail();
    }
    filter = (IsLikeExtended) objUnderTest.createFilter(parameterList);
    assertNull(filter.getLiteral());
    assertNull(filter.getExpression());
    parameterList.add(ff.literal("expr2"));
    parameterList.add(ff.literal("expr3"));
    parameterList.add(ff.literal("expr4"));
    parameterList.add(ff.literal("expr5"));
    parameterList.add(ff.literal(true));
    filter = (IsLikeExtended) objUnderTest.createFilter(parameterList);
    assertNotNull(filter.getLiteral());
    assertNotNull(filter.getExpression());
    System.out.println(filter.toString());
}
Also used : IsLikeExtended(com.sldeditor.filter.v2.function.misc.IsLike.IsLikeExtended) Expression(org.opengis.filter.expression.Expression) ArrayList(java.util.ArrayList) FilterConfigInterface(com.sldeditor.filter.v2.function.FilterConfigInterface) IsLike(com.sldeditor.filter.v2.function.misc.IsLike) CQLException(org.geotools.filter.text.cql2.CQLException) Test(org.junit.Test)

Aggregations

FilterConfigInterface (com.sldeditor.filter.v2.function.FilterConfigInterface)1 IsLike (com.sldeditor.filter.v2.function.misc.IsLike)1 IsLikeExtended (com.sldeditor.filter.v2.function.misc.IsLike.IsLikeExtended)1 ArrayList (java.util.ArrayList)1 CQLException (org.geotools.filter.text.cql2.CQLException)1 Test (org.junit.Test)1 Expression (org.opengis.filter.expression.Expression)1