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

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


        //SensorLookup lookup = new SensorLookupImpl(map);

        try {
            Vector v = new Vector();
            v.add(new StringConstant(s1));
            Expression es1 = new ToREAL32(v,true);

            v.clear();
            v.add(new StringConstant(s2));
            Expression es2 = new ToREAL32(v,true);

            v.clear();
            v.add(new FloatConstant(fn1.floatValue()));
            Expression efn1 = new ToREAL32(v,true);

            v.clear();
            v.add(new FloatConstant(fn2.floatValue()));
            Expression efn2 = new ToREAL32(v,true);

            v.clear();
            v.add(propertySensor1);
            Expression eps1 = new ToREAL32(v,true);

            v.clear();
            v.add(propertySensor2);
            Expression eps2 = new ToREAL32(v,true);

            v.clear();
            v.add(propertySensor3);
            Expression eps3 = new ToREAL32(v,true);

            v.clear();
            v.add(propertySensor4);
            Expression eps4 = new ToREAL32(v,true);

            assertTrue(((Float) es1.evaluate()).equals(fn1));
            assertTrue(((Float) es2.evaluate()).equals(fn2));
            assertFalse(((Float) es1.evaluate()).equals(fn2));
            assertTrue(((Float) efn1.evaluate()).equals(fn1));
            assertTrue(((Float) efn2.evaluate()).equals(fn2));
            assertFalse(((Float) efn1.evaluate()).equals(fn2));
            s1 = s1.substring(1, s1.length()-1);
            assertTrue(((Float) eps1.evaluate()).equals(new Float(s1)));
            s2 = s2.substring(1, s2.length()-1);
            assertTrue(((Float) eps2.evaluate()).equals(new Float(s2)));
            assertTrue(((Float) eps3.evaluate()).equals(fn1));
            assertTrue(((Float) eps4.evaluate()).equals(fn2));

      //assertSame(fn1.getClass(), (efn1.evaluate()).getClass());
        } catch (SPLException e) {
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {
View Full Code Here

TOP

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

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.