Examples of AviatorString


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

    @Test
    public void testCall_WithOneArgument() throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        System.setOut(new PrintStream(out));
        AviatorObject[] args = new AviatorObject[1];
        args[0] = new AviatorString("hello");
        fun.call(null, args);
        out.flush();
        out.close();
        byte[] data = out.toByteArray();
        assertEquals("hello", new String(data));
View Full Code Here

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

    public void testCall_WithTwoArgument() throws Exception {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        System.setOut(new PrintStream(out));
        AviatorObject[] args = new AviatorObject[2];
        args[0] = new AviatorJavaType("out");
        args[1] = new AviatorString("hello");
        Map<String, Object> env = new HashMap<String, Object>();
        env.put("out", out);
        fun.call(env, args);
        out.flush();
        out.close();
View Full Code Here

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

        for (int i = 0; i < strs.length; i++) {
            strs[i] = "hello" + i;
        }
        args[0] = new AviatorRuntimeJavaType(strs);
        SeqPredicateFunction predicate =
                new SeqPredicateFunction("eq_temp_1", OperatorType.EQ, new AviatorString("hello1"));
        Map<String, Object> env = new HashMap<String, Object>();
        env.putAll(AviatorEvaluator.FUNC_MAP);
        env.put("eq_temp_1", predicate);
        args[1] = new AviatorJavaType("eq_temp_1");
        SeqFilterFunction fun = new SeqFilterFunction();
View Full Code Here

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

        for (int i = 0; i < 10; i++) {
            strs.add("hello" + i);
        }
        args[0] = new AviatorRuntimeJavaType(strs);
        SeqPredicateFunction predicate =
                new SeqPredicateFunction("eq_temp_1", OperatorType.EQ, new AviatorString("hello1"));
        Map<String, Object> env = new HashMap<String, Object>();
        env.putAll(AviatorEvaluator.FUNC_MAP);
        env.put("eq_temp_1", predicate);
        args[1] = new AviatorJavaType("eq_temp_1");
        SeqFilterFunction fun = new SeqFilterFunction();
View Full Code Here

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

    }


    @Test(expected = ClassCastException.class)
    public void testClassCastError2() {
        function.call(null, AviatorNumber.valueOf(3.2), new AviatorString("hello"));
    }
View Full Code Here

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

    }


    @Test(expected = ClassCastException.class)
    public void testClassCastError2() {
        function.call(null, new AviatorString("hello"));
    }
View Full Code Here

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

    }


    @Test(expected = IllegalArgumentException.class)
    public void testIllegalArguments_one() {
        this.function.call(null, new AviatorString("hello"));
    }
View Full Code Here

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

    }


    @Test(expected = IllegalArgumentException.class)
    public void testIllegalArguments_Three() {
        this.function.call(null, new AviatorString("hello"), new AviatorString("hello"), new AviatorString("hello"));
    }
View Full Code Here

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

    }


    @Test(expected = ClassCastException.class)
    public void testClassCastError1() {
        this.function.call(null, AviatorBoolean.TRUE, new AviatorString("hello"));
    }
View Full Code Here

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

    }


    @Test(expected = ClassCastException.class)
    public void testClassCastError2() {
        this.function.call(null, new AviatorString("hello"), new AviatorLong(3));
    }
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.