Package com.volantis.xml.namespace

Examples of com.volantis.xml.namespace.ImmutableExpandedName


        Item[] intval = { factory.createIntValue(2) };
        Item[] doubleval = { factory.createDoubleValue(2.2) };
        Value result;

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "empty"),
                factory.createSequence(empty));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "intval"),
                factory.createSequence(intval));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "doubleval"),
                factory.createSequence(doubleval));

        result = compileExpression("$doubleval * 0.2").evaluate(context);
        assertEquals("Operator '*' failed,", 2.2 * 0.2, ((DoubleValue) result)
                .asJavaDouble(), 0.0000001);
View Full Code Here


        Item[] intval = { factory.createIntValue(2) };
        Item[] doubleval = { factory.createDoubleValue(2.2) };
        Value result;

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "empty"),
                factory.createSequence(empty));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "intval"),
                factory.createSequence(intval));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "doubleval"),
                factory.createSequence(doubleval));

        result = compileExpression("$doubleval div 0.2").evaluate(context);
        assertEquals("Operator 'div' failed,", 2.2 / 0.2,
                ((DoubleValue) result).asJavaDouble(), 0.0000001);
View Full Code Here

        Item[] intval = { factory.createIntValue(2) };
        Item[] doubleval = { factory.createDoubleValue(2.2) };
        Value result;

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "empty"),
                factory.createSequence(empty));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "intval"),
                factory.createSequence(intval));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "doubleval"),
                factory.createSequence(doubleval));

        result = compileExpression("$doubleval mod 0.2").evaluate(context);
        assertEquals("Operator 'mod' failed,", 2.2 % 0.2,
                ((DoubleValue) result).asJavaDouble(), 0.0000001);
View Full Code Here

        Item[] intval = { factory.createIntValue(2) };
        Item[] doubleval = { factory.createDoubleValue(2.2) };
        Value result;

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "empty"),
                factory.createSequence(empty));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "intval"),
                factory.createSequence(intval));
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "doubleval"),
                factory.createSequence(doubleval));

        result = compileExpression("- $doubleval").evaluate(context);
        assertEquals("Operator '-' failed,", -2.2, ((DoubleValue) result)
                .asJavaDouble(), 0.0000001);
View Full Code Here

     * @throws Exception
     *             if an error occurs
     */
    public void testStringLessThan() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "a"),
                factory.createStringValue("a"));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "ab"),
                factory.createStringValue("ab"));

        doTestOperatorExpression("<", "$ab < $a", true);
        doTestOperatorExpression("<", "$a < $ab", false);
        doTestOperatorExpression("<", "$a < $a", false);
View Full Code Here

     * Tests that the <= operator works with 2 string values
     * @throws Exception if an error occurs
     */
    public void testStringLessThanOrEqual() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "a"),
                factory.createStringValue("a"));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "ab"),
                factory.createStringValue("ab"));

        doTestOperatorExpression("<=", "$ab <= $a", true);
        doTestOperatorExpression("<=", "$a <= $ab", false);
        doTestOperatorExpression("<=", "$a <= $a", true);
View Full Code Here

     * Tests that the > operator works with 2 string values
     * @throws Exception if an error occurs
     */
    public void testStringGreaterThan() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "a"),
                factory.createStringValue("a"));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "ab"),
                factory.createStringValue("ab"));

        doTestOperatorExpression(">", "$ab > $a", false);
        doTestOperatorExpression(">", "$a > $ab", true);
        doTestOperatorExpression(">", "$a > $a", false);
View Full Code Here

     * Tests that the >= operator works with 2 string values
     * @throws Exception if an error occurs
     */
    public void testStringGreaterThanOrEqual() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "a"),
                factory.createStringValue("a"));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "ab"),
                factory.createStringValue("ab"));

        doTestOperatorExpression(">=", "$ab >= $a", false);
        doTestOperatorExpression(">=", "$a >= $ab", true);
        doTestOperatorExpression(">=", "$a >= $a", true);
View Full Code Here

     */
    public void testNot() throws Exception {
        Value one = factory.createIntValue(1);

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                one);

        Expression exp = compileExpression("not(3 < $myVar)");

        Value result = exp.evaluate(context);
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testBooleanNumericSequenceArg() throws Exception {
        Sequence seq = factory.createDoubleValue(1.0).getSequence();
        context.getCurrentScope().declareVariable(
                        new ImmutableExpandedName("", "myVar"),
                        seq);

        Expression exp = compileExpression("boolean($myVar)");

        Value result = exp.evaluate(context);
View Full Code Here

TOP

Related Classes of com.volantis.xml.namespace.ImmutableExpandedName

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.