Search in sources :

Example 96 with ELProcessor

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

the class TestAstSetData method testSimple01.

@Test
public void testSimple01() {
    ELProcessor processor = new ELProcessor();
    Object result = processor.getValue("{'a','b','c'}", Set.class);
    Assert.assertEquals(simpleSet, result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 97 with ELProcessor

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

the class TestAstSetData method testNested01.

@Test
public void testNested01() {
    ELProcessor processor = new ELProcessor();
    Object result = processor.getValue("{{'a','b','c'},{},'d'}", Set.class);
    Assert.assertEquals(nestedSet, result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 98 with ELProcessor

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

the class TestAstAnd method test02.

@Test
public void test02() {
    ELProcessor processor = new ELProcessor();
    Boolean result = processor.eval("true && null");
    Assert.assertEquals(Boolean.FALSE, result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 99 with ELProcessor

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

the class TestAstAnd method test04.

@Test
public void test04() {
    ELProcessor processor = new ELProcessor();
    Boolean result = processor.eval("null && null");
    Assert.assertEquals(Boolean.FALSE, result);
}
Also used : ELProcessor(jakarta.el.ELProcessor) Test(org.junit.Test)

Example 100 with ELProcessor

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

the class TestAstChoice method test01.

@Test
public void test01() {
    ELProcessor processor = new ELProcessor();
    Long result = processor.eval("null?1:2");
    Assert.assertEquals(Long.valueOf(2), 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