Examples of AviatorLong


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

        Number number = FunctionUtils.getNumberValue(0, args, env);
        if (number instanceof Double || number instanceof Float) {
            return new AviatorDouble(Math.abs(number.doubleValue()));
        }
        else {
            return new AviatorLong(Math.abs(number.longValue()));
        }
    }
View Full Code Here

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

    public AviatorObject call(Map<String, Object> env, AviatorObject... args) {
        if (args.length != 1) {
            throw new IllegalArgumentException("string.length(string)");
        }
        String value = FunctionUtils.getStringValue(0, args, env);
        return new AviatorLong(value.length());
    }
View Full Code Here

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

    }


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

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

public class NowFunctionUnitTest {

    @Test
    public void testCall() {
        NowFunction now = new NowFunction();
        AviatorLong aviatorLong = (AviatorLong) now.call(null, new AviatorObject[0]);

        assertEquals(System.currentTimeMillis(), (Long) aviatorLong.getValue(null), 5);
    }
View Full Code Here

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

    }


    @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.