|
19 | 19 | import org.apache.fop.apps.Fop; |
20 | 20 | import org.apache.fop.apps.FopFactory; |
21 | 21 | import org.apache.xmlgraphics.util.MimeConstants; |
22 | | -import org.dbdoclet.trafo.html.docbook.DocBookTransformer; |
| 22 | +import org.dbdoclet.trafo.html.docbook.HtmlDocBookTrafo; |
23 | 23 | import org.dbdoclet.trafo.script.Script; |
24 | 24 | import org.junit.Test; |
25 | 25 | import org.w3c.dom.Document; |
26 | 26 | import org.w3c.tidy.Tidy; |
27 | 27 |
|
28 | 28 | public class ApacheFOPConvertHTMLIntegrationTest { |
29 | | - private String inputFile = "src/test/resources/input.html"; |
30 | | - private String style = "src/test/resources/xhtml2fo.xsl"; |
31 | | - private String style1 = "src/test/resources/docbook-xsl/fo/docbook.xsl"; |
32 | | - private String output_jtidy = "src/test/resources/output_jtidy.pdf"; |
33 | | - private String output_html2fo = "src/test/resources/output_html2fo.pdf"; |
34 | | - private String output_herold = "src/test/resources/output_herold.pdf"; |
35 | | - private String foFile = "src/test/resources/input.fo"; |
36 | | - private String xmlFile = "src/test/resources/input.xml"; |
| 29 | + private final String inputFile = "src/test/resources/input.html"; |
| 30 | + private final String style = "src/test/resources/xhtml2fo.xsl"; |
| 31 | + private final String style1 = "src/test/resources/docbook-xsl/fo/docbook.xsl"; |
| 32 | + private final String output_jtidy = "src/test/resources/output_jtidy.pdf"; |
| 33 | + private final String output_html2fo = "src/test/resources/output_html2fo.pdf"; |
| 34 | + private final String output_herold = "src/test/resources/output_herold.pdf"; |
| 35 | + private final String foFile = "src/test/resources/input.fo"; |
| 36 | + private final String xmlFile = "src/test/resources/input.xml"; |
37 | 37 |
|
38 | 38 | @Test |
39 | 39 | public void whenTransformHTMLToPDFUsingJTidy_thenCorrect() throws Exception { |
@@ -114,8 +114,9 @@ private Document fromXMLFileToFO() throws Exception { |
114 | 114 |
|
115 | 115 | private void fromHTMLTOXMLUsingHerold() throws Exception { |
116 | 116 | final Script script = new Script(); |
117 | | - final DocBookTransformer transformer = new DocBookTransformer(); |
118 | | - transformer.setScript(script); |
119 | | - transformer.convert(new FileInputStream(inputFile), new FileOutputStream(xmlFile)); |
| 117 | + final HtmlDocBookTrafo transformer = new HtmlDocBookTrafo(); |
| 118 | + transformer.setInputStream(new FileInputStream(inputFile)); |
| 119 | + transformer.setOutputStream(new FileOutputStream(xmlFile)); |
| 120 | + transformer.transform(script); |
120 | 121 | } |
121 | 122 | } |
0 commit comments