Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Function.invoke()


                new Value[] { duration });
        assertEquals(result, factory.createIntValue(12));

        duration =
                factory.createDurationValue(true, 0, 0, 0, 123, 0, 0, 0);
        result = function.invoke(
                expressionContextMock,
                new Value[] { duration });
        assertEquals(result, factory.createIntValue(3));

        duration =
View Full Code Here


                new Value[] { duration });
        assertEquals(result, factory.createIntValue(3));

        duration =
                factory.createDurationValue(false, 0, 0, 3, 10, 0, 0, 0);
        result = function.invoke(
                expressionContextMock,
                new Value[] { duration });
        assertEquals(result, factory.createIntValue(-10));
    }
View Full Code Here

        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 0, 0, 3, 10, 0, 0, 0);
        result = function.invoke(
                expressionContextMock,
                new Value[] { duration });
        assertEquals(result, factory.createIntValue(0));

        duration =
View Full Code Here

                new Value[] { duration });
        assertEquals(result, factory.createIntValue(0));

        duration =
                factory.createDurationValue(false, 0, 0, 5, 12, 30, 0, 0);
        result = function.invoke(
                expressionContextMock,
                new Value[] { duration });
        assertEquals(result, factory.createIntValue(-30));
    }
View Full Code Here

        DurationValue duration;
        Value result;

        duration =
                factory.createDurationValue(true, 0, 0, 3, 10, 0, 12, 5);
        result = function.invoke(
                expressionContextMock,
                new Value[] { duration });
        assertEquals(result, factory.createDoubleValue(12.5));

        duration =
View Full Code Here

                new Value[] { duration });
        assertEquals(result, factory.createDoubleValue(12.5));

        duration =
                factory.createDurationValue(false, 0, 0, 0, 0, 0, 256, 0);
        result = function.invoke(
                expressionContextMock,
                new Value[] { duration });
        assertEquals(result, factory.createDoubleValue(-16.0));
    }
View Full Code Here

            }
           
        };
        final Function stringFunction = new StringFunction();
        try {
            stringFunction.invoke(expressionContextMock, new Value[0]);
            fail("Exception wasn't thrown when empty arguments passed" +
                    " to function");
        } catch (Exception e) {
            // ignore it, expected situation
        }
View Full Code Here

                    " to function");
        } catch (Exception e) {
            // ignore it, expected situation
        }
        for (int i = 0; i < 10; i++) {
            final Value result = stringFunction.invoke(expressionContextMock,
                    new Value[] {testValue});
            assertTrue("Incorrect or null Value from StringFunction",
                    result != null && result instanceof StringValue);
            assertEquals(((StringValue) result).asJavaString(),
                    String.valueOf(i));
View Full Code Here

        // Create an empty sequence.
        Sequence sequence = Sequence.EMPTY;

        Function function = new ExistsFunction();
        Value result =
                function.invoke(expressionContextMock, new Value[] {sequence});
        assertSame(result, BooleanValue.FALSE);
    }

    /**
     * Test that the function returns true for a non-empty sequence.
View Full Code Here

            BooleanValue.TRUE
        });

        Function function = new ExistsFunction();
        Value result =
                function.invoke(expressionContextMock, new Value[] {sequence});
        assertSame(result, BooleanValue.TRUE);
    }

}
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.