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

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


        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new ShortConstant((short) 5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new ShortConstant((short) 20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new ShortConstant((short) 20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here


        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new IntegerConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new IntegerConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new IntegerConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new LongConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new LongConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new LongConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new FloatConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new DoubleConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new IntegerConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new IntegerConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new IntegerConstant(-20));
            v.add(new IntegerConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new LongConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new LongConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new IntegerConstant(-20));
            v.add(new LongConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new IntegerConstant(-20));
            v.add(new FloatConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new IntegerConstant(-20));
            v.add(new DoubleConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

        // Property1 < Property2 (20 < 5) = false   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new LessOrEqual(v,true);

            // Property3 < Property1 (-20 < 20) = true   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new LessOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new LessOrEqual(v,true);

            // Property1 < 5 (false)
            v.clear();
            v.add(propertySensor1);
            v.add(new LongConstant(5));
            Expression expression4 = new LessOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new LongConstant(20));
            Expression expression5 = new LessOrEqual(v,true);

            //-20 < 20 (true)
            v.clear();
            v.add(new LongConstant(-20));
            v.add(new LongConstant(20));
            Expression expression6 = new LessOrEqual(v,true);

            assertFalse(
                ((Boolean) expression1.evaluate()).booleanValue());
            assertTrue(((Boolean) expression2.evaluate()).booleanValue());
            assertTrue(((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertTrue(((Boolean) expression5.evaluate()).booleanValue());
            assertTrue(((Boolean) expression6.evaluate()).booleanValue());
        } catch (SPLException e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {  
          logger.severe("Received evaluation exception " + e.getMessage());
View Full Code Here

TOP

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

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.