Package org.araneaframework.backend.list.sqlexpr.compare

Examples of org.araneaframework.backend.list.sqlexpr.compare.SqlLowerThanExpression


    }
  }
 
  class LowerThanTranslator extends ComparingExprToSqlExprTranslator {
    protected SqlExpression translateComparable(Expression expr, SqlExpression sql1, SqlExpression sql2) {
      return new SqlLowerThanExpression(sql1, sql2);
    }
View Full Code Here


  public void testSqlLowerThanExpression() {
    log.debug("Testing SqlLowerThanExpression");
    // constructing
    try {
      new SqlLowerThanExpression(null, null);
      fail("Constructing of SqlLowerThanExpression with NULL as SqlExpression arguments should fail");
    } catch (Exception e) {
      // normal
    }
    try {
      new SqlLowerThanExpression(null, new MockSqlStringExpression("a"));
      fail("Constructing of SqlLowerThanExpression with NULL as first SqlExpression argument should fail");
    } catch (Exception e) {
      // normal
    }
    try {
      new SqlLowerThanExpression(new MockSqlStringExpression("a"), null);
      fail("Constructing of SqlLowerThanExpression with NULL as second SqlExpression argument should fail");
    } catch (Exception e) {
      // normal
    }

    // SQL String
    assertEquals("SqlLowerThanExpression must return \" < \"",
        new SqlLowerThanExpression(new MockSqlStringExpression(""),
            new MockSqlStringExpression("")).toSqlString(), " < ");
    assertEquals("SqlLowerThanExpression must return \"a < b\"",
        new SqlLowerThanExpression(new MockSqlStringExpression("a"),
            new MockSqlStringExpression("b")).toSqlString(),
        "a < b");

    // SQL arguments
    assertTrue("SqlLowerThanExpression must return an empty array", Arrays
        .equals(new SqlLowerThanExpression(new MockSqlStringExpression(
            ""), new MockSqlStringExpression("")).getValues(),
            new Object[0]));
    assertTrue("SqlLowerThanExpression must return an empty array", Arrays
        .equals(new SqlLowerThanExpression(new MockSqlStringExpression(
            new Object[] { "a" }), new MockSqlStringExpression(
            new Object[] { "b" })).getValues(), new Object[] { "a",
            "b" }));
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.backend.list.sqlexpr.compare.SqlLowerThanExpression

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.