1 61 62 package org.apache.commons.dbutils; 63 64 import java.util.Iterator ; 65 66 71 public class ResultSetIteratorTest extends BaseTestCase { 72 73 77 public ResultSetIteratorTest(String arg0) { 78 super(arg0); 79 } 80 81 public void testNext() { 82 83 Iterator iter = new ResultSetIterator(this.rs); 84 85 int rowCount = 0; 86 Object [] row = null; 87 while (iter.hasNext()) { 88 rowCount++; 89 row = (Object []) iter.next(); 90 91 assertNotNull(row); 92 assertEquals(COLS, row.length); 93 } 94 95 assertEquals(ROWS, rowCount); 96 assertEquals("4", row[0]); 97 assertEquals("5", row[1]); 98 assertEquals("6", row[2]); 99 } 100 101 } 102 | Popular Tags |