Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Value


     */
    public void testOperatorAdd() throws Exception {
        Item[] empty = {};
        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(
View Full Code Here


     */
    public void testOperatorSubtract() throws Exception {
        Item[] empty = {};
        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(
View Full Code Here

     */
    public void testOperatorMultiply() throws Exception {
        Item[] empty = {};
        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(
View Full Code Here

     */
    public void testOperatorDivide() throws Exception {
        Item[] empty = {};
        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(
View Full Code Here

     */
    public void testOperatorMod() throws Exception {
        Item[] empty = {};
        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(
View Full Code Here

     */
    public void testOperatorNegate() throws Exception {
        Item[] empty = {};
        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(
View Full Code Here

    private void doTestOperatorExpression(String operator,
                                          String expression,
                                          boolean expected) throws Exception {
        // compile and evalute the expression
        Expression exp = compileExpression(expression);
        Value result = exp.evaluate(context);

        // check the result type
        assertTrue(operator + " expression should result in a boolean value",
                   result instanceof BooleanValue);
View Full Code Here

    /**
     * Test for the not function in expressions
     * @throws Exception if an error occurs
     */
    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);

        assertTrue("fn:not expression should result in a boolean value",
                   result instanceof BooleanValue);

        assertTrue("fn:not expression result should be true",
View Full Code Here

     */
    public void testNotWithTrue() throws Exception {

        Expression exp = compileExpression("not(true())");

        Value result = exp.evaluate(context);

        assertTrue("fn:not expression should result in a boolean value",
                   result instanceof BooleanValue);

        assertFalse("fn:not expression result should be false",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testBooleanStringArg() throws Exception {
        Expression exp = compileExpression("boolean(\"1\")");

        Value result = exp.evaluate(context);

        assertTrue("fn:boolean should result in a boolean value",
                   result instanceof BooleanValue);

        assertTrue("fn:boolean expression result should be true",
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.Value

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.