Package javax.el

Examples of javax.el.ELProcessor


    }


    @Test
    public void testSimple01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("{'a','b','c'}", Set.class);
        Assert.assertEquals(simpleSet, result);
    }
View Full Code Here


    }


    @Test
    public void testSimple02() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("{}", Set.class);
        Assert.assertEquals(Collections.EMPTY_SET, result);
    }
View Full Code Here

    }


    @Test
    public void testNested01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("{{'a','b','c'},{},'d'}", Set.class);
        Assert.assertEquals(nestedSet, 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, "${{'a','b','c'}}", Set.class);
View Full Code Here

public class TestAstIdentifier {

    @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);
    }
View Full Code Here

    }


    @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);
    }
View Full Code Here

    /**
     * Test string concatenation.
     */
    @Test
    public void testConcatenation01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("'a' += 'b'", String.class);
        Assert.assertEquals("ab", result);
    }
View Full Code Here

    /**
     * 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);
    }
View Full Code Here

    /**
     * Test string concatenation with mixed types.
     */
    @Test
    public void testConcatenation04() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("'a' += 3", String.class);
        Assert.assertEquals("a3", result);
    }
View Full Code Here

    /**
     * Test operator precedence (+ before +=).
     */
    @Test
    public void testPrecedence01() {
        ELProcessor processor = new ELProcessor();
        Object result = processor.getValue("1 + 2 += 3", String.class);
        Assert.assertEquals("33", 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.