TableAppender { private void appendShapes(final XMLUtil util, final Appendable appendable, final List<Shape> shapes) throws IOException { if (shapes.isEmpty()) { return; } appendable.append("<table:shapes>"); for (final Shape shape : shapes) { shape.appendXMLContent(util, appendable); } appendable.append("</table:shapes>"); } TableAppender(final TableBuilder builder); void appendXMLToContentEntry(final XMLUtil util, final Appendable appendable); void appendPostamble(final Appendable appendable); void appendPreambleOnce(final XMLUtil util, final Appendable appendable); void appendPreamble(final XMLUtil util, final Appendable appendable); void appendAllAvailableRows(final XMLUtil util, final Appendable appendable); void appendRemainingRowsFrom(final XMLUtil util, final Appendable appendable,
                                        final int rowIndex); void appendSomeAvailableRowsFrom(final XMLUtil util, final Appendable appendable,
                                            final int rowIndex); boolean isPreambleWritten();  }
@Test public void appendShapesTest() throws IOException { final DrawFrame drawFrame = DrawFrame.builder("a", new DrawImage("href"), SVGRectangle.cm(0, 1, 2, 3)).build(); PowerMock.resetAll(); EasyMock.expect(this.tb.getName()).andReturn("table1"); EasyMock.expect(this.tb.getStyleName()).andReturn("table-style1"); EasyMock.expect(this.tb.getCustomValueByAttribute()).andReturn(null); EasyMock.expect(this.tb.getColumns()) .andReturn(FastFullList.<TableColumnImpl>newListWithCapacity(1)); EasyMock.expect(this.tb.getShapes()).andReturn(Arrays.<Shape>asList(drawFrame)); PowerMock.replayAll(); this.assertPreambleXMLEquals( "<table:table table:name=\"table1\" table:style-name=\"table-style1\" " + "table:print=\"false\">" + "<office:forms form:automatic-focus=\"false\" " + "form:apply-design-mode=\"false\"/>" + "<table:table-column table:style-name=\"co1\" " + "table:number-columns-repeated=\"1024\" " + "table:default-cell-style-name=\"Default\"/>" + "<table:shapes><draw:frame draw:name=\"a\" " + "draw:z-index=\"0\" svg:width=\"2cm\" svg:height=\"3cm\" svg:x=\"0cm\" " + "svg:y=\"1cm\"><draw:image xlink:href=\"href\" xlink:type=\"simple\" " + "xlink:show=\"embed\" xlink:actuate=\"onLoad\"/>" + "</draw:frame></table:shapes>"); PowerMock.verifyAll(); }