Search in sources :

Example 91 with ELProcessor

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

the class TestAstOr method test01.

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

Example 92 with ELProcessor

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

the class TestAstOr method test03.

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

Example 93 with ELProcessor

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

the class TestAstOr method test02.

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

Example 94 with ELProcessor

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

the class TestAstOr 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 95 with ELProcessor

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

the class TestAstSetData method testGetType.

@Test
public void testGetType() {
    ELProcessor processor = new ELProcessor();
    ELContext context = processor.getELManager().getELContext();
    ExpressionFactory factory = ELManager.getExpressionFactory();
    ValueExpression ve = factory.createValueExpression(context, "${{'a','b','c'}}", Set.class);
    Assert.assertEquals(Set.class, ve.getType(context));
    Assert.assertEquals(simpleSet, ve.getValue(context));
}
Also used : ELContext(jakarta.el.ELContext) ExpressionFactory(jakarta.el.ExpressionFactory) ValueExpression(jakarta.el.ValueExpression) 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