TableCellWalker implements RowCellWalker, TableRowWalker, TableColumn { @Override public void toRow(final int r) throws IOException { if (r < 0) { throw new IndexOutOfBoundsException(); } this.r = r; this.c = 0; this.updateShortcuts(this.table); } TableCellWalker(final Table table); @Override void markRowsSpanned(final int n); @Override void setBooleanValue(final boolean value); @Override void setText(final Text text); @Override void setCellMerge(final int rowMerge, final int columnMerge); @Override void setColumnsSpanned(final int n); @Override void markColumnsSpanned(final int n); @Override void setDateValue(final Date value); @Override void setFloatValue(final Number value); @Override void setPercentageValue(final Number value); @Override void setRowsSpanned(final int n); @Override void setVoidValue(); @Override void setMatrixFormula(final String formula); @Override void setMatrixFormula(final String formula, final int matrixRowsSpanned,
                                 final int matrixColumnsSpanned); @Override void setStringValue(final String value); @Override void setTimeValue(final long timeInMillis); @Override void setTimeValue(final long years, final long months, final long days, final long hours,
                             final long minutes, final double seconds); @Override void setNegTimeValue(final long years, final long months, final long days,
                                final long hours, final long minutes, final double seconds); @Override void setTooltip(final String tooltipText); @Override void setTooltip(final String tooltipText, final Length width, final Length height,
                           final boolean visible); @Override void setTooltip(final Tooltip tooltip); @Override void setFormula(final String formula); @Override boolean hasValue(); @Override boolean isCovered(); @Override void setCovered(); @Override void setCellValue(final CellValue value); @Override void setCurrencyValue(final float value, final String currency); @Override void setCurrencyValue(final int value, final String currency); @Override void setCurrencyValue(final Number value, final String currency); @Override void setDateValue(final Calendar cal); @Override void setFloatValue(final float value); @Override void setFloatValue(final int value); @Override void setPercentageValue(final float value); @Override void setPercentageValue(final int value); @Override void setStyle(final TableCellStyle style); @Override void setDataStyle(final DataStyle dataStyle); @Override void setColumnStyle(final TableColumnStyle columnStyle); @Override void setColumnDefaultCellStyle(final TableCellStyle cellStyle); @Override void setColumnAttribute(final String attribute, final CharSequence value); @Override void setRowFormat(final DataStyles format); @Override void setRowStyle(final TableRowStyle rowStyle); @Override int getColumnCount(); @Override void setRowDefaultCellStyle(final TableCellStyle ts); @Override int rowIndex(); @Override int colIndex(); @Override void removeRowStyle(); @Override void setRowAttribute(final String attribute, final CharSequence value); @Override boolean hasNext(); @Override boolean hasPrevious(); @Override void last(); @Override void next(); @Beta void set(final WritableTableCell cell); @Override void previous(); @Override void to(final int c); @Override boolean hasNextRow(); @Override boolean hasPreviousRow(); @Override void lastRow(); @Override void nextRow(); @Override void previousRow(); @Override void toRow(final int r); Table getTable(); void addData(final DataWrapper data); @Override void setAttribute(final String attribute, final CharSequence value);  }
@Test public void testToRow() throws IOException { PowerMock.resetAll(); this.initWalker(0); EasyMock.expect(this.table.getRow(10)).andReturn(this.row); EasyMock.expect(this.row.getOrCreateCell(0)).andReturn(this.cell); PowerMock.replayAll(); this.cellWalker = new TableCellWalker(this.table); this.cellWalker.toRow(10); PowerMock.verifyAll(); }
@Test public void testToRowFail() throws IOException { PowerMock.resetAll(); this.initWalker(0); EasyMock.expect(this.table.getRow(10)).andReturn(this.row); EasyMock.expect(this.row.getOrCreateCell(0)).andReturn(this.cell); PowerMock.replayAll(); this.cellWalker = new TableCellWalker(this.table); this.thrown.expect(IndexOutOfBoundsException.class); this.cellWalker.toRow(-10); PowerMock.verifyAll(); }