From 710e89cc5d37715693e40fa113385c715e8c4e2b Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sun, 14 Mar 2021 13:38:29 +0100 Subject: [PATCH] Added split files align to pages test --- .../html5/SplitFilesAlignToPages.java | 35 ++++++++++++++++++ testdocuments/input/split_files.odt | Bin 0 -> 11331 bytes testdocuments/model/split_files.html | 22 +++++++++++ testdocuments/model/split_files1.html | 22 +++++++++++ 4 files changed, 79 insertions(+) create mode 100644 src/r_tests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java create mode 100644 testdocuments/input/split_files.odt create mode 100644 testdocuments/model/split_files.html create mode 100644 testdocuments/model/split_files1.html diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java b/src/r_tests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java new file mode 100644 index 0000000..ed6282d --- /dev/null +++ b/src/r_tests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java @@ -0,0 +1,35 @@ +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 SplitFilesAlignToPages { + @Test + @DisplayName("Split files align to pages") + void testExample() throws Exception { + String testName = "split_files"; + List arguments = new ArrayList(); + arguments.add("-page_break_style"); + arguments.add("height:3em;margin-top:1em;margin-bottom:1em;background-color:red;"); + arguments.add("-split_level=1"); + arguments.add("-align_splits_to_pages=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 result1 = new File("./testdocuments/output/" + testName + ".html"); + File result2 = new File("./testdocuments/output/" + testName + "1.html"); + File model1 = new File("./testdocuments/model/" + testName + ".html"); + File model2 = new File("./testdocuments/model/" + testName + "1.html"); + assertTrue(FileUtils.contentEquals(result1, model1), "The files differ!"); + assertTrue(FileUtils.contentEquals(result2, model2), "The files differ!"); + + } +} diff --git a/testdocuments/input/split_files.odt b/testdocuments/input/split_files.odt new file mode 100644 index 0000000000000000000000000000000000000000..3a2e9e88d46246483896a12fa8cdac12aa9120ee GIT binary patch literal 11331 zcmb7q1ymf_)^!scf&?1(;I6^l-QC@t#x+5LTOb5!2<{Nv9YSym?i$=R*iYvDdC9yr zGv9k>t=m=IU3=eKb#7fbXDiA;LID8)H~`>-p}n&HXO`!b007`edHM-pXJuyw@^mya za&)w{GBE;KIoLD0*_$#r7`a%vFgQ4x*_%3;xZ0W7gBU<&9w5a($l&1M{vdn8|J$BF zo!J@LTbY}=fEb)j&4=C%*#|PA1|9JRn+?whGD1T;Q}s7kXSBZx(S&9^O+i~~jee)D zlvA{u@pZjSoOL;RbLf%@c|%O=t07HFMFN@`S@qmG23Rj?Vcd?u&UQW#WhmOCrej6TRZ>m)p0QcfvoH;To^p;Y+JOIG;n!P{o2|(yPCv`YWkJD0l9Noj)1)e zU&JQJjg+B%smf=Mt?%d*BSw{H8Wj5N-6)a=ea?o+url((xIG|D$ae>nHy4$50HC0X zuh|3RCT*S`>fb>ZBhbiiS>9MjD!mVIdyAQtO>!B)KV6HPNhtlDn6)vyQ(9;8C4`Qv z5{AlX#7I%OghpWHU7xDdy^j_yPm=n;W}oS)z4IONP=PL&fB@s$x`@osdi-s(Z>)%c z%R~g=gtO&=vDN8X^we?|S=)z4+6nxmGE6s3y2oAP*7tWKnV?vYdHg{lZ?h!w6z2=E zPE)Iz@x~*+`z^evavW4&S(yk9`}gB`!CtD3MXC(_4o|(X4qBv6{dmmJIm2}Svkf#+ z24S1Pvcfg}mobm~YT9oSL`z2$EgYYvu#BBqEF*&nU+axA391rjlUJ1E$tzqc*&Q*9YWph5LL6()yc7OU|tLEJ6cOD)V9dssCC~Wh&tG`KX2*Z zneB~f8dwClprSL_o z*|j%evu6~w4#P1odrc#AZml|!d-OWH;hcNT#mMM>ib3uL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jn&aLgoz8`;S{H5TN04(%r@2@BW@eBy~dp+KhAAYl+>b#$*pNY}m zC1pQ^cfU;T>Ga?Jdy?V(ME=Z4{krmBlCxjmqn=v$e+tn4-1uK$0N{uC>6i8Y1=;U{ zwEvdp*;8WeKO6PCK<)2&ek9y}8TViC{1UAFw=9l-!SYMM_V+A5BxS!W?=M*XENJ_C zra#}+%3m=361e?6%b(kW`IKh-&u9E+!Q0<6{n_h^f5G&-0PbHrKRfa7dH+9m;?O6a z-vx0$JMmBC?8T614uI68MSw+4cW39s3Jqi}d%&*`F*w>;65B@#j`c zK4mt3PlNm?^7ruHk2J?GOL#*5mh|{f;O|5DkLchpdyn;dtnfc^zmGdV2KZlwNbxtr Zy`l{ClM>@ck_HWs@ibgT|Ii5o{vQJwn#TYD literal 0 HcmV?d00001 diff --git a/testdocuments/model/split_files.html b/testdocuments/model/split_files.html new file mode 100644 index 0000000..dfcb142 --- /dev/null +++ b/testdocuments/model/split_files.html @@ -0,0 +1,22 @@ + + + + Default + + + + +
+
+

Heading 1

+

Text 1

+

Heading 2

+

text2

+

Heading 3

+

Text 3

+
+
+ + diff --git a/testdocuments/model/split_files1.html b/testdocuments/model/split_files1.html new file mode 100644 index 0000000..480b38f --- /dev/null +++ b/testdocuments/model/split_files1.html @@ -0,0 +1,22 @@ + + + + Default + + + + +
+
+
+

Heading 1

+

Text 4

+

Heading 3

+

Text 5

+

Heading 1

+
+
+ +