Package javax.el

Examples of javax.el.ELProcessor


    }


    @Test
    public void testSpec05() {
        ELProcessor processor = new ELProcessor();
        Object result =
                processor.getValue("fact = n -> n==0? 1: n*fact(n-1); fact(5)",
                        Integer.class);
        Assert.assertEquals(Integer.valueOf(120), result);
    }
View Full Code Here


    }


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

    }


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

    }


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

    }


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

    }


    @Test(expected=ELException.class)
    public void testNested03() {
        ELProcessor processor = new ELProcessor();
        // More method parameters than there are nested lambda expressions
        processor.getValue("(()->y->()->2-y)()(1)()()",
                    Integer.class);
    }
View Full Code Here

    }


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

    }


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

    }


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

    }


    @Test
    public void testNested07() {
        ELProcessor processor = new ELProcessor();
        Object result =
                processor.getValue("()->()->()->42",
                        Integer.class);
        Assert.assertEquals(Integer.valueOf(42), 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.