SQLResultSet implements IPentahoResultSet, IPeekable { public Object[] peek() { if ( peekRow == null ) { peekRow = next(); } return peekRow; } SQLResultSet( final ResultSet nativeResultSet, final SQLConnection nativeConnection ); void setMetaData( final IPentahoMetaData metadata ); IPentahoMetaData getMetaData(); Object[] peek(); Object[] next(); void closeConnection(); void close(); void dispose(); boolean isScrollable(); int getColumnCount(); int getRowCount(); Object getValueAt( final int row, final int column ); IPentahoResultSet memoryCopy(); void beforeFirst(); Object[] getDataColumn( final int column ); Object[] getDataRow( final int row );  }
@Test public void testPeek() throws SQLException { Object value = "testObject"; when( nativeResultSet.getObject( anyInt() ) ).thenReturn( value ); when( nativeResultSet.next() ).thenReturn( true ); SQLResultSet resultSet = new SQLResultSet( nativeResultSet, nativeConnection ); Object[] objects = resultSet.peek(); for ( int i = 0; i < objects.length; i++ ) { assertEquals( value, objects[i] ); } }