diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10.java b/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10.java new file mode 100644 index 0000000..954dfa4 --- /dev/null +++ b/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10.java @@ -0,0 +1,29 @@ +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 PageStartWith10 { + @Test + @DisplayName("start page from 10 in section") + void testExample() throws Exception { + String testName = "start_page_from_10_in_section"; + List arguments = new ArrayList(); + arguments.add("-page_break_style"); + arguments.add("height:3em;margin-top:1em;margin-bottom:1em;background-color:red;"); + 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/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java b/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java new file mode 100644 index 0000000..096c42b --- /dev/null +++ b/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java @@ -0,0 +1,29 @@ +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 PageStartWith10InSection { + @Test + @DisplayName("start page from 10") + void testExample() throws Exception { + String testName = "start_page_from_10"; + List arguments = new ArrayList(); + arguments.add("-page_break_style"); + arguments.add("height:3em;margin-top:1em;margin-bottom:1em;background-color:red;"); + 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/start_page_from_10.odt b/testdocuments/input/start_page_from_10.odt new file mode 100644 index 0000000..5a75de0 Binary files /dev/null and b/testdocuments/input/start_page_from_10.odt differ diff --git a/testdocuments/input/start_page_from_10_in_section.odt b/testdocuments/input/start_page_from_10_in_section.odt new file mode 100644 index 0000000..9f0c57f Binary files /dev/null and b/testdocuments/input/start_page_from_10_in_section.odt differ diff --git a/testdocuments/model/start_page_from_10.html b/testdocuments/model/start_page_from_10.html new file mode 100644 index 0000000..7dc6b27 --- /dev/null +++ b/testdocuments/model/start_page_from_10.html @@ -0,0 +1,23 @@ + + + + Default + + + + +
+
+

10 Header

+
+
+

Text

+
+ +
+ +