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

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


            //true
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
           
            Expression expression1 = new LogicalAnd(v,true);

            //false
            v.clear();
            v.add(propertySensor6);
            v.add(propertySensor7);
           
            Expression expression2 = new LogicalAnd(v,true);

            //false
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor6);
           
            Expression expression3 = new LogicalAnd(v,true);

            //false
            v.clear();
            v.add(propertySensor1);
            v.add(new BooleanConstant(false));
          
            Expression expression4 = new LogicalAnd(v,true);

            //false
            v.clear();
            v.add(new BooleanConstant(true));
            v.add(new BooleanConstant(false));
            Expression expression5 = new LogicalAnd(v,true);

            //true
            v.clear();
            v.add(new BooleanConstant(true));
            v.add(new BooleanConstant(true));
            Expression expression6 = new LogicalAnd(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression3.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression4.evaluate()).booleanValue());
            assertFalse(
                ((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


    case SPLTreeParserTokenTypes.LOR:
      returnExpr = new LogicalOr(exprList, validateExpr);
      break;

    case SPLTreeParserTokenTypes.LAND:
      returnExpr = new LogicalAnd(exprList, validateExpr);
      break;

    case SPLTreeParserTokenTypes.BXOR:
      returnExpr = new LogicalXor(exprList, validateExpr);
      break;
View Full Code Here

TOP

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

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.