1 61 62 package org.apache.commons.dbutils.handlers; 63 64 import java.sql.SQLException ; 65 66 import org.apache.commons.dbutils.BaseTestCase; 67 import org.apache.commons.dbutils.ResultSetHandler; 68 69 74 public class ArrayHandlerTest extends BaseTestCase { 75 76 79 public ArrayHandlerTest(String name) { 80 super(name); 81 } 82 83 public void testHandle() throws SQLException { 84 ResultSetHandler h = new ArrayHandler(); 85 Object [] results = (Object []) h.handle(this.rs); 86 87 assertNotNull(results); 88 assertEquals(COLS, results.length); 89 assertEquals("1", results[0]); 90 assertEquals("2", results[1]); 91 assertEquals("3", results[2]); 92 } 93 94 public void testEmptyResultSetHandle() throws SQLException { 95 ResultSetHandler h = new ArrayHandler(); 96 Object [] results = (Object []) h.handle(this.emptyResultSet); 97 98 assertNull(results); 99 } 100 101 } 102 | Popular Tags |