Search in sources :

Example 41 with FilterNameParameter

use of com.sldeditor.filter.v2.function.FilterNameParameter in project sldeditor by robward-scisys.

the class FilterNameTest method testGetFilterName.

/**
 * Test method for {@link
 * com.sldeditor.filter.v2.function.FilterName#FilterName(java.lang.String, java.lang.Class)}.
 * Test method for {@link com.sldeditor.filter.v2.function.FilterName#getFilterName()}. Test
 * method for {@link com.sldeditor.filter.v2.function.FilterName#getReturnType()}. Test method
 * for {@link com.sldeditor.filter.v2.function.FilterName#getParameterList()}. Test method for
 * {@link com.sldeditor.filter.v2.function.FilterName#getParameter(int)}. Test method for {@link
 * com.sldeditor.filter.v2.function.FilterName#addParameter(com.sldeditor.filter.v2.function.FilterNameParameter)}.
 */
@Test
public void testGetFilterName() {
    String filterName = "test filter";
    Class<?> returnType = String.class;
    FilterName f = new FilterName(filterName, returnType);
    assertTrue(filterName.compareTo(f.getFilterName()) == 0);
    assertEquals(returnType, f.getReturnType());
    FilterNameParameter p1 = new FilterNameParameter("parameter 1", ExpressionTypeEnum.LITERAL, Integer.class);
    f.addParameter(p1);
    assertEquals(1, f.getParameterList().size());
    assertEquals(null, f.getParameter(-1));
    assertEquals(null, f.getParameter(99));
    assertEquals(p1, f.getParameter(0));
}
Also used : FilterName(com.sldeditor.filter.v2.function.FilterName) FilterNameParameter(com.sldeditor.filter.v2.function.FilterNameParameter) Test(org.junit.jupiter.api.Test)

Aggregations

FilterName (com.sldeditor.filter.v2.function.FilterName)40 FilterNameParameter (com.sldeditor.filter.v2.function.FilterNameParameter)40 Date (java.util.Date)13 Geometry (org.locationtech.jts.geom.Geometry)10 Filter (org.opengis.filter.Filter)3 FilterConfigInterface (com.sldeditor.filter.v2.function.FilterConfigInterface)2 Test (org.junit.jupiter.api.Test)2 BoundingBox (org.opengis.geometry.BoundingBox)1