Package org.apache.myfaces.extensions.cdi.core.impl.activation

Examples of org.apache.myfaces.extensions.cdi.core.impl.activation.PropertyExpressionInterpreter


public class PropertyExpressionInterpreterTest
{
    @Test
    public void testSimplePropertyExpressions()
    {
        ExpressionInterpreter<String, Boolean> interpreter = new PropertyExpressionInterpreter(){};

        System.setProperty("k.1", "v1");
        assertEquals(interpreter.evaluate("k.1==v1"), Boolean.TRUE);
        assertEquals(interpreter.evaluate("k.1==v2"), Boolean.FALSE);

        assertEquals(interpreter.evaluate("k.1!=v1"), Boolean.FALSE);
        assertEquals(interpreter.evaluate("k.1!=v2"), Boolean.TRUE);

        try
        {
            assertEquals(interpreter.evaluate("k.1=v1"), Boolean.TRUE);
        }
        catch (IllegalStateException e)
        {
            return;
        }
View Full Code Here


    }

    @Test
    public void testSimpleAndRequiredPropertyExpressions()
    {
        ExpressionInterpreter<String, Boolean> interpreter = new PropertyExpressionInterpreter(){};

        System.setProperty("k.1", "v1");
        assertEquals(interpreter.evaluate("k.1==v1;k.1==*"), Boolean.TRUE);
        assertEquals(interpreter.evaluate("ik.1==*"), Boolean.FALSE);

        assertEquals(interpreter.evaluate("k.1!=v2;k.1==*"), Boolean.TRUE);
        assertEquals(interpreter.evaluate("ik.1!=v2;ik.1==*"), Boolean.FALSE);
    }
View Full Code Here

    }

    @Test
    public void testMultiplePropertyExpressions()
    {
        ExpressionInterpreter<String, Boolean> interpreter = new PropertyExpressionInterpreter(){};

        System.setProperty("k.1", "v1");
        System.setProperty("k.2", "v2");
        assertEquals(interpreter.evaluate("k.1==v1;k.2==v2"), Boolean.TRUE);
        assertEquals(interpreter.evaluate("k.1==v1;k.2==v1"), Boolean.FALSE);
        assertEquals(interpreter.evaluate("k.1==v2;k.2==v2"), Boolean.FALSE);
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.core.impl.activation.PropertyExpressionInterpreter

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.