Paragraph implements TagParameters, ParagraphElement { public static ParagraphBuilder builder() { return new ParagraphBuilder(); } Paragraph(final List<ParagraphElement> paragraphElements, final TextStyle style); static ParagraphBuilder builder(); @Override void appendXMLContent(final XMLUtil util, final Appendable appendable); @Override void addEmbeddedStylesFromFooterHeader(final StylesContainer stylesContainer); @Override void addEmbeddedStylesFromCell(final StylesContainer stylesContainer); @Override boolean equals(final Object o); @Override final int hashCode();  }
@Test public final void testWithStyle() throws IOException { final TextStyle ts = TextStyle.builder("style").visible().fontStyleNormal().fontWeightNormal().build(); this.parBuilder.style(ts).span("text"); this.assertParXMLEquals("<text:p text:style-name=\"style\">text</text:p>"); }
@Test public final void testStyledLinks() throws IOException, URISyntaxException { final TextStyle ts = TextStyle.builder("style").visible().fontStyleNormal().fontWeightNormal().build(); final Table table = PowerMock.createMock(Table.class); PowerMock.resetAll(); EasyMock.expect(table.getName()).andReturn("tableName"); PowerMock.replayAll(); this.parBuilder.styledLink("to_ref", ts, "#ref").styledLink("to_file", ts, new File("f")) .styledLink("to_url", ts, new URL("http: .styledLink("to_uri", ts, new URI("protocol:a")).styledLink("to_table", ts, table); this.assertParXMLEquals( "<text:p>" + "<text:a text:style-name=\"style\" xlink:href=\"#ref\" " + "xlink:type=\"simple\">to_ref</text:a>" + "<text:a text:style-name=\"style\" xlink:href=\"" + this.getURLStart() + "f\" xlink:type=\"simple\">to_file</text:a>" + "<text:a " + "text:style-name=\"style\" xlink:href=\"http: "xlink:type=\"simple\">to_url</text:a>" + "<text:a " + "text:style-name=\"style\" xlink:href=\"protocol:a\" " + "xlink:type=\"simple\">to_uri</text:a>" + "<text:a text:style-name=\"style\" xlink:href=\"#tableName\" " + "xlink:type=\"simple\">to_table</text:a>" + "</text:p>"); PowerMock.verifyAll(); }