Package javax.el

Examples of javax.el.ELProcessor


    }


    @Test(expected=ELException.class)
    public void testMin03() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[].stream().min()",
                Object.class);

        ((Optional) result).get();
    }
View Full Code Here


    }


    @Test(expected=ELException.class)
    public void testMin04() {
        ELProcessor processor = new ELProcessor();
        processor.defineBean("beans", beans);

        processor.getValue(
                "beans.stream().min()",
                Object.class);
    }
View Full Code Here

    }


    @Test
    public void testMinLambda01() {
        ELProcessor processor = new ELProcessor();
        processor.defineBean("beans", beans);

        Object result = processor.getValue(
                "beans.stream().min((x,y)->x.name.compareTo(y.name))",
                Object.class);

        Assert.assertEquals(bean01, ((Optional) result).get());
    }
View Full Code Here

    }


    @Test
    public void testAverage01() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[1,2,3,4,5].stream().average()",
                Object.class);

        Number average = (Number) ((Optional) result).get();
        Assert.assertTrue("Result: " + average.toString(),
View Full Code Here

    }


    @Test
    public void testAverage02() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[1,2,3,4,5,6].stream().average()",
                Object.class);

        Number average = (Number) ((Optional) result).get();
        Assert.assertTrue("Result: " + average.toString(),
View Full Code Here

    }


    @Test(expected=ELException.class)
    public void testAverage03() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[].stream().average()",
                Object.class);

        ((Optional) result).get();
    }
View Full Code Here

    }


    @Test
    public void testAverage04() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[].stream().average().orElseGet(()->10)",
                Object.class);

        Assert.assertEquals(Long.valueOf(10), result);
    }
View Full Code Here

    }


    @Test
    public void testAverage05() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[].stream().average().orElseGet(()->()->10)",
                Object.class);

        Assert.assertEquals(Long.valueOf(10), result);
    }
View Full Code Here

    }


    @Test(expected=ELException.class)
    public void testAverage06() {
        ELProcessor processor = new ELProcessor();

        processor.getValue(
                "[].stream().average().orElseGet(10)",
                Object.class);
    }
View Full Code Here

    }


    @Test
    public void testSum01() {
        ELProcessor processor = new ELProcessor();

        Object result = processor.getValue(
                "[1,2,3,4,5].stream().sum()",
                Object.class);

        Assert.assertTrue("Result: " + result.toString(),
                ELSupport.equals(Long.valueOf(15), 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.