TableHelper { public void setCellValue(final Table table, final int rowIndex, final int colIndex, final CellValue value, final TableCellStyle ts) throws IOException { final TableCell cell = this.getCell(table, rowIndex, colIndex); cell.setCellValue(value); cell.setStyle(ts); } TableHelper(final PositionUtil positionUtil); static TableHelper create(); @Deprecated void setCellMerge(final Table table, final int rowIndex, final int colIndex,
                             final int rowMerge, final int columnMerge); void setCellMerge(final Table table, final String address, final int rowMerge,
                             final int columnMerge); void setCellValue(final Table table, final int rowIndex, final int colIndex,
                             final CellValue value, final TableCellStyle ts); void setCellValue(final Table table, final int rowIndex, final int colIndex,
                             final CellValue value); void setCellValue(final Table table, final String address, final CellValue value,
                             final TableCellStyle ts); void setCellValue(final Table table, final String address, final CellValue value); TableCellWalker getCell(final Table table, final int rowIndex, final int colIndex); TableCellWalker getCell(final Table table, final String address);  }
@Test public final void testSetCellValueByAddress() throws IOException, ParseException { final CellValue value = new StringValue("@"); PowerMock.resetAll(); EasyMock.expect(this.table.getWalker()).andReturn(this.walker); this.walker.toRow(6); this.walker.to(2); this.walker.setCellValue(value); PowerMock.replayAll(); this.tableHelper.setCellValue(this.table, "C7", value); PowerMock.verifyAll(); }
@Test public final void testSetCellValueWithStyleByAddress() throws IOException, ParseException { final CellValue value = new StringValue("@"); final TableCellStyle ts = TableCellStyle.builder("b").build(); PowerMock.resetAll(); EasyMock.expect(this.table.getWalker()).andReturn(this.walker); this.walker.toRow(6); this.walker.to(3); this.walker.setCellValue(value); this.walker.setStyle(ts); PowerMock.replayAll(); this.tableHelper.setCellValue(this.table, "D7", value, ts); PowerMock.verifyAll(); }
@Test public final void testSetCellValue() throws IOException { final CellValue value = new StringValue("@"); PowerMock.resetAll(); EasyMock.expect(this.table.getWalker()).andReturn(this.walker); this.walker.toRow(8); this.walker.to(4); this.walker.setCellValue(value); PowerMock.replayAll(); this.tableHelper.setCellValue(this.table, 8, 4, value); PowerMock.verifyAll(); }
@Test public final void testSetCellValueWithStyle() throws IOException { final CellValue value = new StringValue("@"); final TableCellStyle ts = TableCellStyle.builder("b").build(); PowerMock.resetAll(); EasyMock.expect(this.table.getWalker()).andReturn(this.walker); this.walker.toRow(1); this.walker.to(1); this.walker.setCellValue(value); this.walker.setStyle(ts); PowerMock.replayAll(); this.tableHelper.setCellValue(this.table, 1, 1, value, ts); PowerMock.verifyAll(); }