diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java b/src/r_tests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java new file mode 100644 index 0000000..76bc96a --- /dev/null +++ b/src/r_tests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java @@ -0,0 +1,30 @@ +package w2phtml.regressionTests.html5; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +public class GreenstoneHeadings { + @Test + @DisplayName("Greenstone3 tags headings") + void testExample() throws Exception { + String testName = "gs_headings"; + List arguments = new ArrayList(); + arguments.add("-page_break_style"); + arguments.add("height:3em;margin-top:1em;margin-bottom:1em;background-color:red;"); + arguments.add("-greenstone=true"); + arguments.add("-html5"); + arguments.add("./testdocuments/input/" + testName + ".odt"); + arguments.add("./testdocuments/output/" + testName + ".html"); + w2phtml.Application.main(arguments.toArray(new String[0])); + File result = new File("./testdocuments/output/" + testName + ".html"); + File model = new File("./testdocuments/model/" + testName + ".html"); + assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + } +} diff --git a/testdocuments/input/gs_headings.odt b/testdocuments/input/gs_headings.odt new file mode 100644 index 0000000..7e7bdc4 Binary files /dev/null and b/testdocuments/input/gs_headings.odt differ diff --git a/testdocuments/model/gs_headings.html b/testdocuments/model/gs_headings.html new file mode 100644 index 0000000..3219de3 --- /dev/null +++ b/testdocuments/model/gs_headings.html @@ -0,0 +1,82 @@ + + + + Default + + + + + + +
+
+

Heading 1

+

Text 1

+
+
+ +
+
+

Heading 2

+

text2

+
+
+ +
+
+

Heading 3

+

Text 3

+
+
+ + + + +
+
+

Heading 1

+

Text 4

+
+
+ +
+
+

Heading 3

+

Text 5

+
+
+ + + +
+
+

Heading 1

+
+
+ + + +