Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Value.stringValue()


                      factory.createStringValue("qwe"),
                      factory.createStringValue("rty"),
                      factory.createStringValue("asd")
                })});
        assertTrue(result instanceof StringValue);
        assertEquals("asd", result.stringValue().asJavaString());
    }
   
    /**
     * Tests on sequence of strings and numbers. {@link ExpressionException}
     * should be thrown.
View Full Code Here


                      factory.createStringValue("qwe"),
                      factory.createStringValue("rty"),
                      factory.createStringValue("asd")
                })});
        assertTrue(result instanceof StringValue);
        assertEquals("rty", result.stringValue().asJavaString());
    }
   
    /**
     * Tests on sequence of strings and numbers. {@link ExpressionException}
     * should be thrown.
View Full Code Here

       
        assertTrue("Expression should result in a string value",
                   eval instanceof StringValue);

        assertEquals("Expression result not as",
                     "(a, b), (c, d), e",  eval.stringValue().asJavaString());
    }
   

    public void testExpressionWithFunction() throws Exception {
        ImmutableExpandedName functionName =
View Full Code Here

        assertTrue("Expression should result in a string value",
                   eval instanceof StringValue);

        assertEquals("Expression result not as",
                     "a 2 " + result.stringValue().asJavaString(),
                     eval.stringValue().asJavaString());
    }

    /**
     * Test to ensure that if a function throws an
     * <code>ExpressionException</code> this is propagated correctly when
View Full Code Here

                        // attriubute.
                        output.removeAttribute(i);
                    } else {
                        // update the current attribute with the string
                        // representation of the evaluated expression.
                        output.setValue(i, result.stringValue().asJavaString());
                    }
                }
                catch (Exception e) {
                    // something went wrong when evaluating the xpath.
                    // Send an error down the pipeline
View Full Code Here

     * Tests string as an argument.
     */
    public void testStringArgument() throws Exception {
        Value result = function.invoke(context, new Value[] { factory
                .createStringValue("'abc'") });
        String resultString = result.stringValue().asJavaString();
        assertEquals("Expected value: abc but was: " + resultString,
                resultString, "abc");
    }

    /**
 
View Full Code Here

     * Tests string value as an argument.
     */
    public void testNestedArgument() throws Exception{
        Value result = function.invoke(context,
                new Value[] { factory.createStringValue("pipeline:evaluate('\"abc\"')") });
        String resultString = result.stringValue().asJavaString();
        assertEquals("Expected value: abc but was: " + resultString,
                resultString, "abc");
    }

    /**
 
View Full Code Here

     * Tests duration value as an argument.
     */
    public void testDurationArgument() throws Exception {
        Value result = function.invoke(context, new Value[] { factory
                .createDurationValue(true, 0, 0, 1, 1, 1, 10, 100) });
        String resultString = result.stringValue().asJavaString();
        assertEquals("Expected value: 90070 but was: " + resultString,
                resultString, "90070");
    }
   
    /**
 
View Full Code Here

     * Tests string value as an argument.
     */
    public void testStringArgument() throws Exception{
        Value result = function.invoke(context,
                new Value[] { factory.createStringValue("P0Y0M0DT1H15M0.0S") });  
        String resultString = result.stringValue().asJavaString();
        assertEquals("Expected value: 4500 but was: " + resultString, resultString,
                "4500");
    }
   
    /**
 
View Full Code Here

                     "1 2 3" + ":" +
                     "abc" + ":" +
                     "42 255 7" + ":" +
                     "ho ho little boy" + ":" +
                     "1 2 3",
                     result.stringValue().asJavaString());
    }
}

/*
===========================================================================
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.