Package org.araneaframework.backend.list.sqlexpr.logical

Examples of org.araneaframework.backend.list.sqlexpr.logical.SqlNotExpression


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

    // SQL String
    assertEquals("SqlNotExpression must return \"NOT \"",
        new SqlNotExpression(new MockSqlStringExpression(""))
            .toSqlString(), "NOT ");
    assertEquals("SqlNotExpression must return \"NOT a\"",
        new SqlNotExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "NOT a");

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


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

TOP

Related Classes of org.araneaframework.backend.list.sqlexpr.logical.SqlNotExpression

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.