}
@Test
public void test() throws IOException, SQLException {
ResultSetImpl rs = new ResultSetImpl(null, null, conf, desc);
ResultSetMetaData meta = rs.getMetaData();
assertNotNull(meta);
Schema schema = scoreMeta.getSchema();
assertEquals(schema.getColumnNum(), meta.getColumnCount());
for (int i = 0; i < meta.getColumnCount(); i++) {
assertEquals(schema.getColumn(i).getColumnName(), meta.getColumnName(i + 1));
assertEquals(schema.getColumn(i).getQualifier(), meta.getTableName(i + 1));
assertEquals(schema.getColumn(i).getDataType().getClass().getCanonicalName(),
meta.getColumnTypeName(i + 1));
}
int i = 0;
assertTrue(rs.isBeforeFirst());
for (; rs.next(); i++) {
assertEquals("test"+i%100, rs.getString(1));
assertEquals("test"+i%100, rs.getString("deptname"));
assertEquals(i+1, rs.getInt(2));
assertEquals(i+1, rs.getInt("score"));
}
assertEquals(10000, i);
assertTrue(rs.isAfterLast());
}