Package javax.el

Examples of javax.el.ELProcessor


    }


    @Test
    public void testGetValue03() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("1;2 + 3", Integer.class);
        Assert.assertEquals(Integer.valueOf(5), result);
    }
View Full Code Here


    }


    @Test
    public void testGetType() {
        ELProcessor processor = new ELProcessor();
        ELContext context = processor.getELManager().getELContext();
        ExpressionFactory factory = ELManager.getExpressionFactory();

        ValueExpression ve = factory.createValueExpression(
                context, "${1+1;2+2}", Integer.class);
View Full Code Here

public class TestAstOr {

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

        Assert.assertEquals(Boolean.TRUE, result);
    }

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

        Assert.assertEquals(Boolean.TRUE, result);
    }

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

        Assert.assertEquals(Boolean.TRUE, result);
    }

    @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 TestAstLambdaExpression {

    @Test
    public void testSpec01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("(x->x+1)(1)", Integer.class);
        Assert.assertEquals(Integer.valueOf(2), result);
    }
View Full Code Here

    }


    @Test
    public void testSpec02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("((x,y)->x+y)(1,2)", Integer.class);
        Assert.assertEquals(Integer.valueOf(3), result);
    }
View Full Code Here

    }


    @Test
    public void testSpec03() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("(()->64)", Integer.class);
        Assert.assertEquals(Integer.valueOf(64), result);
    }
View Full Code Here

    }


    @Test
    public void testSpec04() {
        ELProcessor processor = new ELProcessor();
        Object result =
                processor.getValue("v = (x,y)->x+y; v(3,4)", Integer.class);
        Assert.assertEquals(Integer.valueOf(7), result);
    }
View Full Code Here

TOP

Related Classes of javax.el.ELProcessor

Copyright © 2018 www.massapicom. 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.