Package org.auraframework.expression

Examples of org.auraframework.expression.Expression.evaluate()


        e = buildExpression("55 ne 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 ge 55");
        assertTrue("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 le 55");
        assertTrue("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 lt 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 gt 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
    }
View Full Code Here


        e = buildExpression("55 ge 55");
        assertTrue("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 le 55");
        assertTrue("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 lt 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 gt 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
    }

    /**
 
View Full Code Here

        e = buildExpression("55 le 55");
        assertTrue("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 lt 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
        e = buildExpression("55 gt 55");
        assertFalse("Unexpected expression evaluation using alternate relational operators", e.evaluate(null));
    }

    /**
     * Number literals include integers, decimals, and exponents.
     */
 
View Full Code Here

    /**
     * Operators may be accessed as function calls and may be nested.
     */
    public void testFunctionCalls() throws Exception {
        Expression e = buildExpression("or(true, false)");
        assertTrue("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("and(false, true)");
        assertFalse("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("add(24, 23525)");
        assertEquals("Operator could not be accessed as function call", 24 + 23525, e.evaluate(null));

View Full Code Here

     */
    public void testFunctionCalls() throws Exception {
        Expression e = buildExpression("or(true, false)");
        assertTrue("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("and(false, true)");
        assertFalse("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("add(24, 23525)");
        assertEquals("Operator could not be accessed as function call", 24 + 23525, e.evaluate(null));

        e = buildExpression("sub(24, add(63, 23525))");
        assertEquals("Error evaluating nested operators as function calls", 24.0 - (63 + 23525), e.evaluate(null));
View Full Code Here

        Expression e = buildExpression("or(true, false)");
        assertTrue("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("and(false, true)");
        assertFalse("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("add(24, 23525)");
        assertEquals("Operator could not be accessed as function call", 24 + 23525, e.evaluate(null));

        e = buildExpression("sub(24, add(63, 23525))");
        assertEquals("Error evaluating nested operators as function calls", 24.0 - (63 + 23525), e.evaluate(null));

        e = buildExpression("add('The child', ' picked up the teddy bear in one hand')");
View Full Code Here

        assertFalse("Operator could not be accessed as function call", e.evaluate(null));
        e = buildExpression("add(24, 23525)");
        assertEquals("Operator could not be accessed as function call", 24 + 23525, e.evaluate(null));

        e = buildExpression("sub(24, add(63, 23525))");
        assertEquals("Error evaluating nested operators as function calls", 24.0 - (63 + 23525), e.evaluate(null));

        e = buildExpression("add('The child', ' picked up the teddy bear in one hand')");
        assertEquals("Error adding strings with add operator as function call",
                "The child picked up the teddy bear in one hand", e.evaluate(null));
View Full Code Here

        e = buildExpression("sub(24, add(63, 23525))");
        assertEquals("Error evaluating nested operators as function calls", 24.0 - (63 + 23525), e.evaluate(null));

        e = buildExpression("add('The child', ' picked up the teddy bear in one hand')");
        assertEquals("Error adding strings with add operator as function call",
                "The child picked up the teddy bear in one hand", e.evaluate(null));

        e = buildExpression("notequals(add(' and grasped a', ' pick axe in the other.'), '\"Wait!\" screamed the bear.')");
        assertTrue("Error in evaluating nested operators as funtion calls", e.evaluate(null));

        e = buildExpression("if(equals(true, greaterthan(-2, -52)), add('The child hesitated, ', '\"I cannot stuff you without making a hole to stuff into.\"'), ' The bear squinted and noodled on this for a minute.')");
View Full Code Here

        e = buildExpression("add('The child', ' picked up the teddy bear in one hand')");
        assertEquals("Error adding strings with add operator as function call",
                "The child picked up the teddy bear in one hand", e.evaluate(null));

        e = buildExpression("notequals(add(' and grasped a', ' pick axe in the other.'), '\"Wait!\" screamed the bear.')");
        assertTrue("Error in evaluating nested operators as funtion calls", e.evaluate(null));

        e = buildExpression("if(equals(true, greaterthan(-2, -52)), add('The child hesitated, ', '\"I cannot stuff you without making a hole to stuff into.\"'), ' The bear squinted and noodled on this for a minute.')");
        assertEquals("Error in evaluating nested operators as funtion calls",
                "The child hesitated, \"I cannot stuff you without making a hole to stuff into.\"", e.evaluate(null));
    }
View Full Code Here

        e = buildExpression("notequals(add(' and grasped a', ' pick axe in the other.'), '\"Wait!\" screamed the bear.')");
        assertTrue("Error in evaluating nested operators as funtion calls", e.evaluate(null));

        e = buildExpression("if(equals(true, greaterthan(-2, -52)), add('The child hesitated, ', '\"I cannot stuff you without making a hole to stuff into.\"'), ' The bear squinted and noodled on this for a minute.')");
        assertEquals("Error in evaluating nested operators as funtion calls",
                "The child hesitated, \"I cannot stuff you without making a hole to stuff into.\"", e.evaluate(null));
    }

    /**
     * Non-english string literals are parsed correctly.
     */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.