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

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


    //SensorLookup lookup = new SensorLookupImpl(map);

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

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

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

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

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

      assertTrue(
        (Math.round(sn1) - ((Number) e1.evaluate()).shortValue())
          == 0);
      assertTrue(
        (Math.round(in1) - ((Number) e2.evaluate()).intValue())
          == 0);
      assertTrue(
          (Math.round(ln1) - ((Number) e3.evaluate()).intValue())
            == 0);
      assertTrue(
        (Math.round(fn1) - ((Number) e4.evaluate()).intValue())
          == 0);
      assertTrue(
        (Math.round(dn1) - ((Number) e5.evaluate()).longValue())
          == 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.Round

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.