More regression tests

This commit is contained in:
Georgy Litvinov 2021-02-25 20:50:30 +01:00
parent 8b4103a8f5
commit 50313e5f64
7 changed files with 348 additions and 13 deletions

View file

@ -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 ListInSection {
@Test
@DisplayName("List in section")
void testExample() throws Exception {
String testName = "list_in_section";
List<String> arguments = new ArrayList<String>();
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!");
}
}

View file

@ -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 ListInTableInSection {
@Test
@DisplayName("list in table in section")
void testExample() throws Exception {
String testName = "list_in_table_in_section";
List<String> arguments = new ArrayList<String>();
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!");
}
}

View file

@ -13,17 +13,17 @@ import org.junit.jupiter.api.Test;
public class PageSectionStyles {
@Test
@DisplayName("Page styles and sections")
void testExample() throws Exception{
String testName = "image_after_section";
List<String> arguments = new ArrayList<String>();
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!");
}
void testExample() throws Exception {
String testName = "image_after_section";
List<String> arguments = new ArrayList<String>();
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!");
}
}