Search in sources :

Example 66 with ELProcessor

use of jakarta.el.ELProcessor in project tomcat by apache.

the class TestAstLambdaExpression method testLambdaAsFunction04.

@Test(expected = ELException.class)
public void testLambdaAsFunction04() {
    ELProcessor processor = new ELProcessor();
    // More method parameters than there are nested lambda expressions
    processor.getValue("v = (()->y->()->2-y); v()(1)()()", Integer.class);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 67 with ELProcessor

use of jakarta.el.ELProcessor in project tomcat by apache.

the class TestAstLambdaExpression method testLambdaAsFunction03.

@Test
public void testLambdaAsFunction03() {
    ELProcessor processor = new ELProcessor();
    Object result = processor.getValue("v = (()->y->()->2-y); v()(1)()", Integer.class);
    Assert.assertEquals(Integer.valueOf(1), result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 68 with ELProcessor

use of jakarta.el.ELProcessor in project tomcat by apache.

the class TestELArithmetic method testSubtract02.

@Test
public void testSubtract02() {
    ELProcessor processor = new ELProcessor();
    Long result = processor.eval("null - null");
    Assert.assertEquals(Long.valueOf(0), result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 69 with ELProcessor

use of jakarta.el.ELProcessor in project tomcat by apache.

the class TestELArithmetic method testUnaryMinus01.

@Test
public void testUnaryMinus01() {
    ELProcessor processor = new ELProcessor();
    Long result = processor.eval("-null");
    Assert.assertEquals(Long.valueOf(0), result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 70 with ELProcessor

use of jakarta.el.ELProcessor in project tomcat by apache.

the class TestELArithmetic method testMultiply02.

@Test
public void testMultiply02() {
    ELProcessor processor = new ELProcessor();
    Long result = processor.eval("null * null");
    Assert.assertEquals(Long.valueOf(0), result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Aggregations

ELProcessor (jakarta.el.ELProcessor)138 Test (org.junit.Test)133 ArrayList (java.util.ArrayList)13 ELContext (jakarta.el.ELContext)8 ValueExpression (jakarta.el.ValueExpression)8 ExpressionFactory (jakarta.el.ExpressionFactory)7 TesterBeanA (org.apache.el.TesterBeanA)5 List (java.util.List)1