public void testSqlLowerExpression() {
log.debug("Testing SqlLowerExpression");
// constructing
try {
new SqlLowerExpression(null);
fail("Constructing of SqlUpperExpression with NULL as SqlExpression argument should fail");
} catch (Exception e) {
// normal
}
// SQL String
assertEquals("SqlLowerExpression must return \"LOWER()\"",
new SqlLowerExpression(new MockSqlStringExpression(""))
.toSqlString(), "LOWER()");
assertEquals("SqlLowerExpression must return \"LOWER(a)\"",
new SqlLowerExpression(new MockSqlStringExpression("a"))
.toSqlString(), "LOWER(a)");
// SQL arguments
assertTrue("SqlLowerExpression must return an empty array", Arrays
.equals(new SqlLowerExpression(new MockSqlStringExpression(""))
.getValues(), new Object[0]));
assertTrue("SqlLowerExpression must return an empty array", Arrays
.equals(new SqlLowerExpression(new MockSqlStringExpression(
new Object[0])).getValues(), new Object[0]));
assertTrue("SqlLowerExpression must return (\"a\") as values", Arrays
.equals(new SqlLowerExpression(new MockSqlStringExpression(
new Object[] { "a" })).getValues(),
new Object[] { "a" }));
}