Package com.volantis.xml.namespace

Examples of com.volantis.xml.namespace.ImmutableExpandedName


     * Tests that the less than operator works with 2 booleans
     * @throws Exception if an error occurs
     */
    public void testBooleanLessThan() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                BooleanValue.TRUE);

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "anVar"),
                BooleanValue.FALSE);

        doTestOperatorExpression("<", "$myVar < $anVar", false);
        doTestOperatorExpression("<", "$anVar < $myVar", true);
        doTestOperatorExpression("<", "$anVar < $anVar", false);
View Full Code Here


     * Tests that the <= operator works with 2 boolean values
     * @throws Exception if an error occurs
     */
    public void testBooleanLessThanOrEqual() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                BooleanValue.TRUE);

        doTestOperatorExpression("<=", "$myVar <= boolean(\"0\")", false);
        doTestOperatorExpression("<=", "false() <= $myVar", true);
        doTestOperatorExpression("<=", "$myVar <= $myVar", true);
View Full Code Here

     * Tests that the > operator works with 2 booleans
     * @throws Exception if an error occurs
     */
    public void testBooleanGreaterThan() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                BooleanValue.TRUE);

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "anVar"),
                BooleanValue.FALSE);

        doTestOperatorExpression(">", "$myVar > $anVar", true);
        doTestOperatorExpression(">", "$anVar > $myVar", false);
        doTestOperatorExpression(">", "$anVar > $anVar", false);
View Full Code Here

     * Tests that the >= operator works with 2 boolean values
     * @throws Exception if an error occurs
     */
    public void testBooleanGreaterThanOrEqual() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                BooleanValue.TRUE);

        doTestOperatorExpression(">=", "$myVar >= boolean(\"0\")", true);
        doTestOperatorExpression(">=", "false() >= true()", false);
        doTestOperatorExpression(">=", "$myVar >= $myVar", true);
View Full Code Here

     * Tests that the < operator works with 2 numeric values
     * @throws Exception if an error occurs
     */
    public void testNumericLessThan() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                factory.createDoubleValue(2.2));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "anVar"),
                factory.createIntValue(2));

        doTestOperatorExpression("<", "$anVar < $myVar", true);
        doTestOperatorExpression("<", "$myVar < $anVar", false);
        doTestOperatorExpression("<", "$myVar < $myVar", false);
View Full Code Here

     * Tests that the <= operator works with 2 numeric values
     * @throws Exception if an error occurs
     */
    public void testNumericLessThanOrEqual() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                factory.createDoubleValue(2.2));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "anVar"),
                factory.createIntValue(2));

        doTestOperatorExpression("<=", "$anVar <= $myVar", true);
        doTestOperatorExpression("<=", "$myVar <= $anVar", false);
        doTestOperatorExpression("<=", "$myVar <= $myVar", true);
View Full Code Here

     * Tests that the > operator works with 2 numeric values
     * @throws Exception if an error occurs
     */
    public void testNumericGreaterThan() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                factory.createDoubleValue(2.2));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "anVar"),
                factory.createIntValue(2));

        doTestOperatorExpression(">", "$anVar > $myVar", false);
        doTestOperatorExpression(">", "$myVar > $anVar", true);
        doTestOperatorExpression(">", "$myVar > $myVar", false);
View Full Code Here

     * Tests that the >= operator works with 2 numeric values
     * @throws Exception if an error occurs
     */
    public void testNumericGreaterThanOrEqual() throws Exception {
        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "myVar"),
                factory.createDoubleValue(2.2));

        context.getCurrentScope().declareVariable(
                new ImmutableExpandedName("", "anVar"),
                factory.createIntValue(2));

        doTestOperatorExpression(">=", "$anVar >= $myVar", false);
        doTestOperatorExpression(">=", "$myVar >= $anVar", true);
        doTestOperatorExpression(">=", "$myVar >= $myVar", true);
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 + 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 - 0.2").evaluate(context);
        assertEquals("Operator '-' failed,", 2.2 - 0.2, ((DoubleValue) result)
                .asJavaDouble(), 0.0000001);
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.