Package com.googlecode.aviator.runtime.type

Examples of com.googlecode.aviator.runtime.type.AviatorObject


    @Test
    public void testNotFunction() {
        BinaryFunction fun = new BinaryFunction(OperatorType.NOT);
        AviatorObject[] args = new AviatorObject[1];
        args[0] = AviatorBoolean.FALSE;
        AviatorObject result = fun.call(null, args);
        assertTrue((Boolean) result.getValue(null));

    }
View Full Code Here


        AviatorObject[] args = new AviatorObject[2];
        args[0] = new AviatorRuntimeJavaType(a);
        args[1] = new AviatorRuntimeJavaType(-100);

        SeqIncludeFunction fun = new SeqIncludeFunction();
        AviatorObject result = fun.call(null, args);
        assertTrue(result.booleanValue(null));

        // contains null Object
        args[1] = new AviatorRuntimeJavaType(null);
        result = fun.call(null, args);
        assertTrue(result.booleanValue(null));

        // not match
        args[1] = new AviatorRuntimeJavaType(1000);
        result = fun.call(null, args);
        assertFalse(result.booleanValue(null));

    }
View Full Code Here

    public void testIllegalFunction() {
        BinaryFunction fun = new BinaryFunction(OperatorType.EQ);
        AviatorObject[] args = new AviatorObject[2];
        args[0] = AviatorLong.valueOf(10L);
        args[1] = AviatorLong.valueOf(11L);
        AviatorObject result = fun.call(null, args);
    }
View Full Code Here

        AviatorObject[] args = new AviatorObject[2];
        args[0] = new AviatorRuntimeJavaType("hello");
        args[1] = new AviatorRuntimeJavaType("h");

        SeqIncludeFunction fun = new SeqIncludeFunction();
        AviatorObject result = fun.call(null, args);
    }
View Full Code Here

TOP

Related Classes of com.googlecode.aviator.runtime.type.AviatorObject

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.