Examples of AviatorRuntimeJavaType


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

    @Test(expected = IllegalArgumentException.class)
    public void testReduce_String() {

        AviatorObject[] args = new AviatorObject[3];
        args[0] = new AviatorRuntimeJavaType("hello");
        args[1] = new AviatorJavaType("+");
        args[2] = new AviatorRuntimeJavaType(0);

        SeqReduceFunction fun = new SeqReduceFunction();
        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
    }
View Full Code Here

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

        for (int i = 9; i >= 0; i--) {
            a[index++] = i;
        }

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

        SeqSortFunction fun = new SeqSortFunction();
        AviatorObject result = fun.call(null, args);
        index = 0;
        Integer[] dup = (Integer[]) result.getValue(null);
View Full Code Here

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

        for (int i = 9; i >= 0; i--) {
            a.add(i);
        }

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

        SeqSortFunction fun = new SeqSortFunction();
        AviatorObject result = fun.call(null, args);
        index = 0;
        List<Integer> dup = (List<Integer>) result.getValue(null);
View Full Code Here

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

        for (int i = 9; i >= 0; i--) {
            a.add(i);
        }

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

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

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

        Integer[] a = new Integer[3];
        a[0] = 1;
        a[1] = -100;

        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] = AviatorNil.NIL;
        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

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

        a.add(1);
        a.add(-100);
        a.add(null);

        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

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


    @Test(expected = IllegalArgumentException.class)
    public void testInclude_String() {
        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
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.