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

Examples of org.araneaframework.backend.list.memorybased.expression.compare.ComparedEqualsExpression


      .getLogger(SimpleSqlExpressionTest.class);

  public void testSqlExpressionBuilder() throws ExpressionEvaluationException {
    // build expression
    Expression expr = new AndExpression().add(
        new ComparedEqualsExpression(new VariableExpression("name"),
            new ValueExpression("James Bond"), ComparatorFactory
                .getStringComparator(false, true, null))).add(
        new GreaterThanExpression(new VariableExpression("age"),
            new ValueExpression(new Long(25)))).add(
        new EqualsExpression(new VariableExpression("licenseToKill"),
View Full Code Here


  public void testComparedEqualsExpression()
      throws ExpressionEvaluationException {
    log.debug("Testing ComparedEqualsExpression");
    try {
      new ComparedEqualsExpression(null, null).evaluate(this.resolver);
      fail("ComparedEqualsExpression operands can not be nulls");
    } catch (Exception e) {
      // normal
    }
    try {
      new ComparedEqualsExpression(this.low, null)
          .evaluate(this.resolver);
      fail("ComparedEqualsExpression operands can not be nulls");
    } catch (Exception e) {
      // normal
    }
    try {
      new ComparedEqualsExpression(null, this.low)
          .evaluate(this.resolver);
      fail("ComparedEqualsExpression operands can not be nulls");
    } catch (Exception e) {
      // normal
    }

    // evaluating
    assertEquals("ComparedEqualsExpression must return true", Boolean.TRUE,
        new ComparedEqualsExpression(this.low, this.low_copy)
            .evaluate(this.resolver));
    assertEquals("ComparedEqualsExpression must return false",
        Boolean.FALSE,
        new ComparedEqualsExpression(this.low, this.high)
            .evaluate(this.resolver));
    assertEquals("ComparedEqualsExpression must return true", Boolean.TRUE,
        new ComparedEqualsExpression(this.high, this.high)
            .evaluate(this.resolver));
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.backend.list.memorybased.expression.compare.ComparedEqualsExpression

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.