From 2a03ae2c2ae049761ee9d6b26e87c6d9dfae4aae Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sun, 14 Mar 2021 13:37:33 +0100 Subject: [PATCH] Added GS Tags test --- .../html5/GreenstoneHeadings.java | 30 +++++++ testdocuments/input/gs_headings.odt | Bin 0 -> 10833 bytes testdocuments/model/gs_headings.html | 82 ++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 src/r_tests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java create mode 100644 testdocuments/input/gs_headings.odt create mode 100644 testdocuments/model/gs_headings.html 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 0000000000000000000000000000000000000000..7e7bdc4295eeea7b154c599c86f6094279e0de06 GIT binary patch literal 10833 z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?)7YPb{qH~Q zSK-tDl*jHLczzW^{hsHg2Kv*!{D$X0@}}Rjyhx*d+WbGTIQ&H@^*?1of3CLv-9LX7 zPW_(gubx)?2c}t@9 literal 0 HcmV?d00001 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

+
+
+ + + +