Package com.volantis.styling.impl.expressions

Examples of com.volantis.styling.impl.expressions.Arguments


    /**
     * Ensure that empty arguments are handled properly.
     */
    public void testEmptyArguments() {

        Arguments arguments;

        List values = new ArrayList();
        List evaluated;

        arguments = new ArgumentsImpl(values, false);
        evaluated = arguments.evaluate(evaluationContextMock);
        assertEquals(values, evaluated);
    }
View Full Code Here


    /**
     * Ensure that fixed arguments are handled properly.
     */
    public void testFixedArguments() {

        Arguments arguments;

        List values = Arrays.asList(new StyleValue[]{
            STYLE_VALUE_FACTORY.getString(null, "arg 1"),
            STYLE_VALUE_FACTORY.getString(null, "arg 2"),
            STYLE_VALUE_FACTORY.getString(null, "arg 3"),
        });

        arguments = new ArgumentsImpl(values, false);
        List evaluated = arguments.evaluate(evaluationContextMock);
        assertSame(values, evaluated);
    }
View Full Code Here

    /**
     * Ensure that variable arguments are handled properly.
     */
    public void testVariableArguments() {

        Arguments arguments;


        // =====================================================================
        //   Create Mocks
        // =====================================================================
        final StylingExpressionMock expressionMock =
                new StylingExpressionMock("expressionMock",
                        expectations);

        // =====================================================================
        //   Set Expectations
        // =====================================================================

        StyleValue result = STYLE_VALUE_FACTORY.getString(null, "result");

        expressionMock.expects.evaluate(evaluationContextMock).returns(result);

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        List values = Arrays.asList(new StyleValue[]{
            STYLE_VALUE_FACTORY.getString(null, "arg 1"),
            new StyleCompiledExpression(expressionMock),
            STYLE_VALUE_FACTORY.getString(null, "arg 3"),
        });

        List expected = Arrays.asList(new StyleValue[]{
            STYLE_VALUE_FACTORY.getString(null, "arg 1"),
            result,
            STYLE_VALUE_FACTORY.getString(null, "arg 3"),
        });

        arguments = new ArgumentsImpl(values, true);
        List evaluated = arguments.evaluate(evaluationContextMock);
        assertEquals(expected, evaluated);
    }
View Full Code Here

        if (function == null) {
            throw new IllegalStateException("Unknown function '" + name + "'");
        }

        List values = value.getArguments();
        Arguments arguments = compileArguments(values);
        FunctionCall call = new FunctionCall(name, function, arguments);

        compiledValue = new StyleCompiledExpression(call);
    }
View Full Code Here

TOP

Related Classes of com.volantis.styling.impl.expressions.Arguments

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.