Package org.apache.imperius.spl.parser.expressions.impl

Examples of org.apache.imperius.spl.parser.expressions.impl.Mod


        try {
            Vector v = new Vector();
            v.add(new ShortConstant(sn1));
            v.add(new ShortConstant(sn2));
            Expression es = new Mod(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new IntegerConstant(in2));
            Expression ei = new Mod(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new LongConstant(ln2));
            Expression el = new Mod(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            v.add(new FloatConstant(fn2));
            Expression ef = new Mod(v,true);

            v.clear();
            v.add(new DoubleConstant(dn1));
            v.add(new DoubleConstant(dn2));
            Expression ed = new Mod(v,true);

            assertTrue(
                ((sn1 % sn2) - ((Number) es.evaluate()).shortValue())
                    == 0);
            assertTrue(
                ((in1 % in2) - ((Number) ei.evaluate()).intValue()) == 0);
            assertTrue(
                ((ln1 % ln2) - ((Number) el.evaluate()).longValue())
                    == 0);
            assertTrue(
                ((fn1 % fn2) - ((Number) ef.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((dn1 % dn2) - ((Number) ed.evaluate()).doubleValue())
                    == 0);

/*      assertSame(
        (new Integer(sn1 % sn2)).getClass(),
        (es.evaluate()).getClass());
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.expressions.impl.Mod

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.