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

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


  public void testSqlIsNullExpression() {
    log.debug("Testing SqlIsNullExpression");
    // constructing
    try {
      new SqlIsNullExpression(null);
      fail("Constructing of SqlIsNullExpression with NULL as SqlExpression argument should fail");
    } catch (Exception e) {
      // normal
    }

    // SQL String
    assertEquals("SqlIsNullExpression must return \" IS NULL\"",
        new SqlIsNullExpression(new MockSqlStringExpression(""))
            .toSqlString(), " IS NULL");
    assertEquals("SqlIsNullExpression must return \"a IS NULL\"",
        new SqlIsNullExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "a IS NULL");

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


    }
  }
 
  class IsNullTranslator extends CompositeExprToSqlExprTranslator {
    protected SqlExpression translateParent(Expression expr, SqlExpression[] sqlChildren) {
      return new SqlIsNullExpression(sqlChildren[0]);
    }
View Full Code Here

TOP

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

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.