Package javax.el

Examples of javax.el.ELProcessor.eval()


    }

    @Test
    public void test04() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null || null");
        Assert.assertEquals(Boolean.FALSE, result);
    }
}
View Full Code Here


public class TestAstChoice {

    @Test
    public void test01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null?1:2");
        Assert.assertEquals(Long.valueOf(2), result);
    }
}
View Full Code Here

    }

    @Test
    public void testAdd02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null + null");
        Assert.assertEquals(Long.valueOf(0), result);
    }

    @Test
    public void testSubtract01() throws Exception {
View Full Code Here

    }

    @Test
    public void testSubtract02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null - null");
        Assert.assertEquals(Long.valueOf(0), result);
    }

    @Test
    public void testMultiply01() throws Exception {
View Full Code Here

    }

    @Test
    public void testMultiply02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null * null");
        Assert.assertEquals(Long.valueOf(0), result);
    }

    @Test
    public void testDivide01() throws Exception {
View Full Code Here

    }

    @Test
    public void testDivide02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null / null");
        Assert.assertEquals(Long.valueOf(0), result);
    }

    @Test
    public void testMod01() throws Exception {
View Full Code Here

    }

    @Test
    public void testMod02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("null % null");
        Assert.assertEquals(Long.valueOf(0), result);
    }

    @Test
    public void testUnaryMinus01() {
View Full Code Here

    }

    @Test
    public void testUnaryMinus01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.eval("-null");
        Assert.assertEquals(Long.valueOf(0), result);
    }

    @Test
    public void testBug47371bigDecimal() throws Exception {
View Full Code Here

            out.println("</head>");
            out.println("<body>");
            out.println("<h1>ELProcessor</h1>");
            ELProcessor elp = new ELProcessor();
            out.println("Simple array access<br>");
            out.println((elp.eval("a = [1, 2, 3]; a[1]")) + "<br>");
            out.println("Lamda expressions<br>");
            out.println(((elp.eval("((x,y) -> x+y)(4, 5)"))) + "<br>");           
            out.println("</body>");
            out.println("</html>");
        }
View Full Code Here

            out.println("<h1>ELProcessor</h1>");
            ELProcessor elp = new ELProcessor();
            out.println("Simple array access<br>");
            out.println((elp.eval("a = [1, 2, 3]; a[1]")) + "<br>");
            out.println("Lamda expressions<br>");
            out.println(((elp.eval("((x,y) -> x+y)(4, 5)"))) + "<br>");           
            out.println("</body>");
            out.println("</html>");
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.