use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstListData method testSimple02.
@Test
public void testSimple02() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("[]", List.class);
Assert.assertEquals(Collections.EMPTY_LIST, result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstListData method testSimple01.
@Test
public void testSimple01() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("['a','b','c', 'b', 'c']", List.class);
Assert.assertEquals(simpleList, result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstLambdaExpression method testSpec02.
@Test
public void testSpec02() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("((x,y)->x+y)(1,2)", Integer.class);
Assert.assertEquals(Integer.valueOf(3), result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstLambdaExpression method testNested01.
@Test
public void testNested01() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("(()->y->2-y)()(1)", Integer.class);
Assert.assertEquals(Integer.valueOf(1), result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstLambdaExpression method testLambdaAsFunction06.
@Test
public void testLambdaAsFunction06() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("v = (()->y->()->()->x->x-y); v()(1)()()(2)", Integer.class);
Assert.assertEquals(Integer.valueOf(1), result);
}
Aggregations