@Test public void indexedValueRetrieval() throws Exception { ResultSet resultSet = mock(ResultSet.class); RowImpl row = new RowImpl(resultSet); when(resultSet.getByte(13)).thenReturn((byte) 26); assertEquals(26, row.get(13).asByte()); when(resultSet.getBytes(21)).thenReturn("test".getBytes()); assertArrayEquals("test".getBytes(), row.get(21).asByteArray()); when(resultSet.getInt(14)).thenReturn((int) 'a'); assertEquals('a', row.get(14).asCharacter()); when(resultSet.getDouble(15)).thenReturn(1.23); assertEquals(1.23, row.get(15).asDouble(), 0.001); LocalDateTime now = LocalDateTime.now(); when(resultSet.getTimestamp(15)).thenReturn(new Timestamp(Times.toEpochMillis(now))); assertEquals(now, row.get(15).asLocalDateTime()); when(resultSet.getLong(16)).thenReturn(156l); assertEquals(156l, row.get(16).asLong()); when(resultSet.getInt(17)).thenReturn(178); assertEquals(178, row.get(17).asInteger()); when(resultSet.getFloat(18)).thenReturn(8.012f); assertEquals(8.012f, row.get(18).asFloat(), 0.001); when(resultSet.getBoolean(19)).thenReturn(true); assertEquals(true, row.get(19).asBoolean()); when(resultSet.getShort(20)).thenReturn((short) 17); assertEquals((short) 17, row.get(20).asShort()); when(resultSet.getString(21)).thenReturn("test"); assertEquals("test", row.get(21).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();  }