Package com.volantis.xml.expression.sequence

Examples of com.volantis.xml.expression.sequence.Sequence


     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of one "+INF" StringValue Item
     * @throws Exception if an error occurs
     */
    public void testNumberWithPlusInfStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("+INF").getSequence();
        doTestNumber(seq, Double.POSITIVE_INFINITY);
    }
View Full Code Here


     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of one "NaN" StringValue Item
     * @throws Exception if an error occurs
     */
    public void testNumberWithNaNStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("NaN").getSequence();
        DoubleValue result = PipelineExpressionHelper.fnNumber(seq, factory);
        assertTrue("number('NaN') should return NaN DoubleValue",
                   Double.isNaN(result.asJavaDouble()));
    }
View Full Code Here

     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of one "-inf" StringValue item
     * @throws Exception if an error occurs
     */
    public void testNumberWithMinusInfStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("-inf").getSequence();
        doTestNumber(seq, Double.NEGATIVE_INFINITY);
    }
View Full Code Here

     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of one valid double StringValue Item
     * @throws Exception if an error occurs
     */
    public void testNumberWithValidDoubleStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("0.444E5").getSequence();
        doTestNumber(seq, 0.444E5);
    }
View Full Code Here

     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of one invalid double StringValue Item
     * @throws Exception if an error occurs
     */
    public void testNumberWithinValidDoubleStringValueItem() throws Exception {
        Sequence seq = factory.createStringValue("fred").getSequence();
        DoubleValue result = PipelineExpressionHelper.fnNumber(seq, factory);
        assertTrue("number('fred') should return NaN DoubleValue",
                   Double.isNaN(result.asJavaDouble()));
    }
View Full Code Here

     * Tests the {@link PipelineExpressionHelper#fnNumber} method with a Sequence
     * of several Items
     * @throws Exception if an error occurs
     */
    public void testNumberWithSeveralItemSequence() throws Exception {
        Sequence seq = factory.createSequence(
                new Item[]{factory.createStringValue("0.444E5"),
                           factory.createDoubleValue(9.9),
                           BooleanValue.FALSE});

        try {
View Full Code Here

     * sequences
     * @throws Exception if an error occurs
     */
    public void testSequenceEqualityWhenTrue() throws Exception {
        // right operand
        Sequence left = factory.createSequence(new Item[] {
           factory.createIntValue(9),
           factory.createIntValue(6),
           factory.createIntValue(77),
           factory.createIntValue(66),
        });

        // left operand
        Sequence right = factory.createSequence(new Item[] {
           factory.createIntValue(44),
           factory.createIntValue(-33),
           factory.createIntValue(7777),
           factory.createIntValue(11),
           factory.createIntValue(66),
View Full Code Here

     * should produce a false result
     * @throws Exception if an error occurs
     */
    public void testSequenceEqualityWhenFalse() throws Exception {
        // right operand
        Sequence left = factory.createSequence(new Item[] {
           factory.createIntValue(1),
           factory.createIntValue(11),
           factory.createIntValue(7)
        });

        // left operand
        Sequence right = factory.createSequence(new Item[] {
           factory.createIntValue(0),
           factory.createIntValue(99),
           factory.createIntValue(88)
        });

View Full Code Here

     */
    public void testEmptySequenceInput() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = Sequence.EMPTY;
        Value search = factory.createStringValue("a");
        Value retVal = tokenize.invoke(context, new Value[]{sequence, search});

        final Sequence retSeq = retVal.getSequence();

        // Should have returned ()
        assertSame(retSeq, Sequence.EMPTY);
    }
View Full Code Here

     */
    public void testEmptyStringInput() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{""});
        Value search = factory.createStringValue("a");
        Value retVal = tokenize.invoke(context, new Value[]{sequence, search});

        final Sequence retSeq = retVal.getSequence();

        // Should have returned ()
        assertSame(retSeq, Sequence.EMPTY);
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.sequence.Sequence

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.