Package org.araneaframework.backend.list.memorybased.expression.logical

Examples of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression


    public RangesOverlapNonStrict() {
      super();
    }
    protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) {
      AndExpression expr = new AndExpression();
      expr.add(new OrExpression().add(
          new LowerThanExpression(startVar, endVal)).add(
              new EqualsExpression(startVar, endVal)));     
      expr.add(new OrExpression().add(
          new GreaterThanExpression(endVar, startVal)).add(
              new EqualsExpression(endVar, startVal)));
      return expr;     
    }
View Full Code Here


  }

  public void testOrExpression() throws ExpressionEvaluationException {
    log.debug("Testing OrExpression");
    try {
      new OrExpression().evaluate(this.resolver);
      fail("OrExpression must throw an exception");
    } catch (ExpressionEvaluationException e) {
      // normal
    }
    try {
      new OrExpression().add(this.trueExpr).evaluate(this.resolver);
    } catch (ExpressionEvaluationException e) {
      fail("OrExpression must pass with one child");     
    }
    try {
      new OrExpression().add(this.notBoolExpr).add(this.trueExpr).add(
          this.trueExpr).evaluate(this.resolver);
      fail("OrExpression must throw an exception");
    } catch (Exception e) {
      // normal
    }

    assertEquals("OrExpression must return true", Boolean.TRUE,
        new OrExpression().add(this.trueExpr).add(this.trueExpr)
            .evaluate(this.resolver));
    assertEquals("OrExpression must return true", Boolean.TRUE,
        new OrExpression().add(this.falseExpr).add(this.trueExpr)
            .evaluate(this.resolver));
    assertEquals("OrExpression must return true", Boolean.TRUE,
        new OrExpression().add(this.trueExpr).add(this.falseExpr)
            .evaluate(this.resolver));
    assertEquals("OrExpression must return false", Boolean.FALSE,
        new OrExpression().add(this.falseExpr).add(this.falseExpr)
            .evaluate(this.resolver));
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.backend.list.memorybased.expression.logical.OrExpression

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.