public void testSqlValueExpression() {
log.debug("Testing SqlValueExpression");
// constructing
try {
new SqlValueExpression(null);
} catch (Exception e) {
fail("Constructing of SqlValueExpression failed with null-value");
}
try {
new SqlValueExpression("a");
} catch (Exception e) {
fail("Constructing of SqlValueExpression failed with not-null value");
}
// SQL String
assertEquals("SqlValueExpression must return ?",
new SqlValueExpression(null).toSqlString(), "?");
assertEquals("SqlValueExpression must return ?",
new SqlValueExpression("a").toSqlString(), "?");
// SQL arguments
assertTrue("SqlValueExpression must return (null) as values", Arrays
.equals(new SqlValueExpression(null).getValues(),
new Object[] { null }));
assertTrue("SqlValueExpression must return (\"a\") as values", Arrays
.equals(new SqlValueExpression("a").getValues(),
new Object[] { "a" }));
}