Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Value


    * Tests invocation.
    */
    public void testErrorMessage() throws Exception {

       StringValue expected = factory.createStringValue(ERROR_MESSAGE);
       Value result =
           errorMessageFunction.invoke(context, new Value[0]);
       assertEquals(expected, result);
    }
View Full Code Here


    * Tests error code name.
    */
    public void testErrorCodeName() throws Exception {

       StringValue expected = factory.createStringValue(ERROR_CODENAME);
       Value result =
           errorCodeNameFunction.invoke(context, new Value[0]);
       assertEquals(expected, result);
    }
View Full Code Here

    * Tests error code URI.
    */
    public void testErrorCodeURI() throws Exception {

       StringValue expected = factory.createStringValue(ERROR_CODEURI);
       Value result =
           errorCodeURIfunction.invoke(context, new Value[0]);
       assertEquals(expected, result);
    }
View Full Code Here

    /**
     * Tests if empty sequence is returned for empty sequence
     */
    public void testEmptySequence() throws ExpressionException {
        final Function function = new CeilingFunction();
        Value result = function.invoke(expressionContextMock,
                new Value[]{factory.createSequence(new Item[]{})});
        assertTrue(result instanceof Sequence);
        assertEquals(0, result.getSequence().getLength());
    }
View Full Code Here

    /**
    * Tests error info.
    */
    public void testErrorInfo() throws Exception {
        StringValue propertyName = factory.createStringValue(STRING_PROPERTY_NAME);
        Value result =
            errorInfoFunction.invoke(context, new Value[]{propertyName});
        assertEquals(factory.createStringValue(STRING_PROPERTY_VALUE), result);

        propertyName = factory.createStringValue(INT_PROPERTY_NAME);
        result =
View Full Code Here

     * Tests if function works correctly when argument is positive
     * and has fraction less than 0.5
     */
    public void testPositiveFractionLessThanHalf() throws ExpressionException {
        final Function function = new CeilingFunction();
        Value result = function.invoke(expressionContextMock, new Value[]{
                factory.createDoubleValue(10.2)});
        assertTrue(result instanceof DoubleValue);
        assertTrue(11.0 == ((DoubleValue) result).asJavaDouble());
    }
View Full Code Here

    * Tests error source ID.
    */
    public void testErrorSourceID() throws Exception {

       StringValue expected = factory.createStringValue(ERROR_SOURCEID);
       Value result =
           errorSourceIDfunction.invoke(context, new Value[0]);
       assertEquals(expected, result);
    }
View Full Code Here

     * Tests if function works correctly when argument is positive
     * and has fraction greater than 0.5
     */
    public void testPositiveFractionGreaterThanHalf() throws ExpressionException {
        final Function function = new CeilingFunction();
        Value result = function.invoke(expressionContextMock, new Value[]{
                factory.createDoubleValue(10.7)});
        assertTrue(result instanceof DoubleValue);
        assertTrue(11.0 == ((DoubleValue) result).asJavaDouble());
    }
View Full Code Here

     * Tests if function works correctly when argument is negative
     * and has fraction less than 0.5
     */
    public void testNegativeFractionLessThanHalf() throws ExpressionException {
        final Function function = new CeilingFunction();
        Value result = function.invoke(expressionContextMock, new Value[]{
                factory.createDoubleValue(-10.2)});
        assertTrue(result instanceof DoubleValue);
        assertTrue(-10.0 == ((DoubleValue) result).asJavaDouble());
    }
View Full Code Here

     * Tests if function works correctly when argument is negative
     * and has fraction greater than 0.5
     */
    public void testNegativeFractionGreaterThanHalf() throws ExpressionException {
        final Function function = new CeilingFunction();
        Value result = function.invoke(expressionContextMock, new Value[]{
                factory.createDoubleValue(-10.7)});
        assertTrue(result instanceof DoubleValue);
        assertTrue(-10.0 == ((DoubleValue) result).asJavaDouble());
    }
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.