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

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


        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
            v.add(new ShortConstant(sn1));
            Expression e1 = new Abs(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            Expression e2 = new Abs(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            Expression e3 = new Abs(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            Expression e4 = new Abs(v,true);

            v.clear();
            v.add(new DoubleConstant(dn1));
            Expression e5 = new Abs(v,true);

            assertTrue(
                (Math.abs(sn1) - ((Number) e1.evaluate()).shortValue())
                    == 0);
            assertTrue(
                (Math.abs(in1) - ((Number) e2.evaluate()).intValue())
                    == 0);
            assertTrue(
                (Math.abs(ln1) - ((Number) e3.evaluate()).longValue())
                    == 0);
            assertTrue(
                (Math.abs(fn1) - ((Number) e4.evaluate()).floatValue())
                    == 0);
            assertTrue(
                (Math.abs(dn1) - ((Number) e5.evaluate()).doubleValue())
                    == 0);
/*
      assertSame((new Short(sn1)).getClass(), (e1.evaluate()).getClass());
      assertSame((new Integer(in1)).getClass(), (e2.evaluate()).getClass());
      assertSame((new Long(ln1)).getClass(), (e3.evaluate()).getClass());
View Full Code Here

TOP

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

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.