BooleanColumnTranslator implements ColumnTranslator { @Override public String translate(JdbcResultRow rs, int column) throws SQLException, IOException { return String.valueOf(rs.getFieldValue(column)); } BooleanColumnTranslator(); @Override String translate(JdbcResultRow rs, int column); @Override String translate(JdbcResultRow rs, String column);  }
@Test public void testTrueString() throws Exception { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", "true", Types.BOOLEAN); String translated = translator.translate(row, 0); assertEquals("true", translated); }
@Test public void testTrueStringColumnName() throws Exception { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", "true", Types.BOOLEAN); String translated = translator.translate(row, "testField"); assertEquals("true", translated); }
@Test public void testFalseString() throws Exception { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", "false", Types.BOOLEAN); String translated = translator.translate(row, 0); assertEquals("false", translated); }
@Test public void testFalseBoolean() throws Exception { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", new Boolean("false"), Types.BOOLEAN); String translated = translator.translate(row, 0); assertEquals("false", translated); }
@Test public void testTrueBoolean() throws Exception { JdbcResultRow row = new JdbcResultRow(); row.setFieldValue("testField", new Boolean("true"), Types.BOOLEAN); String translated = translator.translate(row, 0); assertEquals("true", translated); }
@Test public void testTrueBool() throws Exception { JdbcResultRow row = new JdbcResultRow(); boolean val = true; row.setFieldValue("testField", val, Types.BOOLEAN); String translated = translator.translate(row, 0); assertEquals("true", translated); }
@Test public void testFalseBool() throws Exception { JdbcResultRow row = new JdbcResultRow(); boolean val = false; row.setFieldValue("testField", val, Types.BOOLEAN); String translated = translator.translate(row, 0); assertEquals("false", translated); }