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

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


        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
          
            Expression expression1 = new LogicalOr(v,true);

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

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

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

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

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


      // expression");
      returnExpr = new AssignmentExpression(exprList, validateExpr);
      break;

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

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

TOP

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

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.