use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstConcatenation method testPrecedence02.
/**
* Test operator precedence (+ before +=).
*/
@Test
public void testPrecedence02() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("1 += 2 + 3", String.class);
Assert.assertEquals("15", result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstConcatenation method testConcatenation03.
/**
* Test string concatenation with whitespace.
*/
@Test
public void testConcatenation03() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("' a' += ' b '", String.class);
Assert.assertEquals(" a b ", result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstConcatenation method testPrecedence04.
/**
* Test operator precedence (+= before >).
*/
@Test
public void testPrecedence04() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("1 += 2 > 3", String.class);
Assert.assertEquals("true", result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstIdentifier method testImport01.
@Test
public void testImport01() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("Integer.MAX_VALUE", Integer.class);
Assert.assertEquals(Integer.valueOf(Integer.MAX_VALUE), result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestAstIdentifier method testImport02.
@Test
public void testImport02() {
ELProcessor processor = new ELProcessor();
processor.getELManager().getELContext().getImportHandler().importStatic("java.lang.Integer.MAX_VALUE");
Object result = processor.getValue("MAX_VALUE", Integer.class);
Assert.assertEquals(Integer.valueOf(Integer.MAX_VALUE), result);
}
Aggregations