public class SQLTest extends DataSourceTestCase {
public void testIsClause() throws Exception {
DataSource d = ds.executeSQL(
"select * from persona where apellido is null;");
d.start();
Value v0 = ValueFactory.createValue(2);
Value v1 = ValueFactory.createValue("fernan");
Value v2 = ValueFactory.createNullValue();
assertTrue(d.getRowCount() == 1);
assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(v0)).getValue());
assertTrue(((BooleanValue) d.getFieldValue(0, 1).equals(v1)).getValue());
assertTrue(d.getFieldValue(0, 2) instanceof NullValue);
d.stop();
d = ds.executeSQL("select * from persona where apellido is not null;");
d.start();
v0 = ValueFactory.createValue(0);
v1 = ValueFactory.createValue("fernando");
v2 = ValueFactory.createValue("gonzalez");
Value v3 = ValueFactory.createValue(1);
Value v4 = ValueFactory.createValue("huracan");
Value v5 = ValueFactory.createValue("gonsales");
assertTrue(d.getRowCount() == 2);
assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(v0)).getValue());
assertTrue(((BooleanValue) d.getFieldValue(0, 1).equals(v1)).getValue());
assertTrue(((BooleanValue) d.getFieldValue(0, 2).equals(v2)).getValue());
assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v3)).getValue());