1 61 62 package org.apache.commons.dbutils.handlers; 63 64 import java.sql.SQLException ; 65 import java.util.Map ; 66 67 import org.apache.commons.dbutils.BaseTestCase; 68 import org.apache.commons.dbutils.ResultSetHandler; 69 70 75 public class MapHandlerTest extends BaseTestCase { 76 77 80 public MapHandlerTest(String name) { 81 super(name); 82 } 83 84 public void testHandle() throws SQLException { 85 ResultSetHandler h = new MapHandler(); 86 Map results = (Map ) h.handle(this.rs); 87 88 assertNotNull(results); 89 assertEquals(COLS, results.keySet().size()); 90 assertEquals("1", results.get("ONE")); 91 assertEquals("2", results.get("two")); 92 assertEquals("3", results.get("Three")); 93 } 94 95 public void testEmptyResultSetHandle() throws SQLException { 96 ResultSetHandler h = new MapHandler(); 97 Map results = (Map ) h.handle(this.emptyResultSet); 98 99 assertNull(results); 100 } 101 102 } 103 | Popular Tags |