@Test public void labeledValueRetrieval() throws Exception { ResultSet resultSet = mock(ResultSet.class); RowImpl row = new RowImpl(resultSet); when(resultSet.getByte("label13")).thenReturn((byte) 26); assertEquals(26, row.get("label13").asByte()); when(resultSet.getBytes("label21")).thenReturn("test".getBytes()); assertArrayEquals("test".getBytes(), row.get("label21").asByteArray()); when(resultSet.getInt("label14")).thenReturn((int) 'a'); assertEquals('a', row.get("label14").asCharacter()); when(resultSet.getDouble("label15")).thenReturn(1.23); assertEquals(1.23, row.get("label15").asDouble(), 0.001); LocalDateTime now = LocalDateTime.now(); when(resultSet.getTimestamp("label15")).thenReturn(new Timestamp(Times.toEpochMillis(now))); assertEquals(now, row.get("label15").asLocalDateTime()); when(resultSet.getLong("label16")).thenReturn(156l); assertEquals(156l, row.get("label16").asLong()); when(resultSet.getInt("label17")).thenReturn(178); assertEquals(178, row.get("label17").asInteger()); when(resultSet.getFloat("label18")).thenReturn(8.012f); assertEquals(8.012f, row.get("label18").asFloat(), 0.001); when(resultSet.getBoolean("label19")).thenReturn(true); assertEquals(true, row.get("label19").asBoolean()); when(resultSet.getShort("label20")).thenReturn((short) 17); assertEquals((short) 17, row.get("label20").asShort()); when(resultSet.getString("label21")).thenReturn("test"); assertEquals("test", row.get("label21").asString()); }
@Override public Value get(int index) { return new IndexedColumnValue(index); }
RowImpl implements Row { @Override public Value get(int index) { return new IndexedColumnValue(index); } }
RowImpl implements Row { @Override public Value get(int index) { return new IndexedColumnValue(index); } RowImpl(ResultSet resultSet); }
RowImpl implements Row { @Override public Value get(int index) { return new IndexedColumnValue(index); } RowImpl(ResultSet resultSet); @Override Value get(int index); @Override Value get(String name); @Override Value get(String table, String name); @Override Value get(Member member); @Override int size(); }
RowImpl implements Row { @Override public Value get(int index) { return new IndexedColumnValue(index); } RowImpl(ResultSet resultSet); @Override Value get(int index); @Override Value get(String name); @Override Value get(String table, String name); @Override Value get(Member member); @Override int size();  }