assertTrue(((BooleanValue)d.getFieldValue(2, 2).equals(ValueFactory.createValue("gonzalez"))).getValue());
d.stop();
}
public void testOrderByWithNullValues() throws Exception {
DataSource d = ds.executeSQL(
"select * from persona order by apellido;");
d.start();
assertTrue(d.getRowCount() == 3);
assertTrue(((BooleanValue)d.getFieldValue(0, 0).equals(ValueFactory.createValue(2))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(0, 1).equals(ValueFactory.createValue("fernan"))).getValue());
assertTrue(d.getFieldValue(0, 2) instanceof NullValue);
assertTrue(((BooleanValue)d.getFieldValue(1, 0).equals(ValueFactory.createValue(1))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(1, 1).equals(ValueFactory.createValue("huracan"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(1, 2).equals(ValueFactory.createValue("gonsales"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(2, 0).equals(ValueFactory.createValue(0))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(2, 1).equals(ValueFactory.createValue("fernando"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(2, 2).equals(ValueFactory.createValue("gonzalez"))).getValue());
d.stop();
d = ds.executeSQL(
"select * from persona order by apellido desc;");
d.start();
assertTrue(d.getRowCount() == 3);
assertTrue(((BooleanValue)d.getFieldValue(0, 0).equals(ValueFactory.createValue(0))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(0, 1).equals(ValueFactory.createValue("fernando"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(0, 2).equals(ValueFactory.createValue("gonzalez"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(1, 0).equals(ValueFactory.createValue(1))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(1, 1).equals(ValueFactory.createValue("huracan"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(1, 2).equals(ValueFactory.createValue("gonsales"))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(2, 0).equals(ValueFactory.createValue(2))).getValue());
assertTrue(((BooleanValue)d.getFieldValue(2, 1).equals(ValueFactory.createValue("fernan"))).getValue());
assertTrue(d.getFieldValue(2, 2) instanceof NullValue);
d.stop();
}