Created first test
This commit is contained in:
parent
80441c4ad9
commit
da9326a19e
4 changed files with 49 additions and 8 deletions
10
build.gradle
10
build.gradle
|
@ -16,7 +16,9 @@ configurations{
|
||||||
bundledLibs
|
bundledLibs
|
||||||
}
|
}
|
||||||
dependencies{
|
dependencies{
|
||||||
testImplementation 'junit:junit:4.13'
|
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.1'
|
||||||
|
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1'
|
||||||
|
testImplementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
|
||||||
|
|
||||||
bundledLibs 'org.libreoffice:jurt:5.3.2'
|
bundledLibs 'org.libreoffice:jurt:5.3.2'
|
||||||
bundledLibs 'org.libreoffice:juh:5.3.2'
|
bundledLibs 'org.libreoffice:juh:5.3.2'
|
||||||
|
@ -25,7 +27,6 @@ dependencies{
|
||||||
bundledLibs 'org.json:json:20190722'
|
bundledLibs 'org.json:json:20190722'
|
||||||
bundledLibs group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
|
bundledLibs group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
|
||||||
bundledLibs group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'
|
bundledLibs group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'
|
||||||
compile 'junit:junit:4.13'
|
|
||||||
bundledLibs group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
|
bundledLibs group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
|
||||||
bundledLibs group: 'org.apache.jena', name: 'jena-core', version: '3.15.0'
|
bundledLibs group: 'org.apache.jena', name: 'jena-core', version: '3.15.0'
|
||||||
bundledLibs group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0'
|
bundledLibs group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0'
|
||||||
|
@ -203,7 +204,10 @@ task oxtNew(type: Zip){
|
||||||
}
|
}
|
||||||
|
|
||||||
task regressionTests(type: Test){
|
task regressionTests(type: Test){
|
||||||
|
useJUnit()
|
||||||
|
testLogging {
|
||||||
|
events "passed", "skipped", "failed"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task setVersion(){
|
task setVersion(){
|
||||||
|
|
|
@ -1,20 +1,33 @@
|
||||||
package w2phtml.regressionTests;
|
package w2phtml.regressionTests;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class TestExample {
|
public class TestExample {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Heading with page break before")
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
//long start = System.nanoTime();
|
|
||||||
List<String> arguments = new ArrayList<String>();
|
List<String> arguments = new ArrayList<String>();
|
||||||
arguments.add("-page_break_style");
|
arguments.add("-page_break_style");
|
||||||
arguments.add("height:3em;margin-top:1em;margin-bottom:1em;background-color:red;");
|
arguments.add("height:3em;margin-top:1em;margin-bottom:1em;background-color:red;");
|
||||||
arguments.add("-html5");
|
arguments.add("-html5");
|
||||||
arguments.add("/home/litvinovg/tmp/w2p-bug/test_5.odt");
|
arguments.add("./testdocuments/input/heading_with_page_break_before.odt");
|
||||||
|
arguments.add("./testdocuments/output/heading_with_page_break_before.html");
|
||||||
w2phtml.Application.main(arguments.toArray(new String[0]));
|
w2phtml.Application.main(arguments.toArray(new String[0]));
|
||||||
//long end = System.nanoTime();
|
// System.out.println("Working Directory = " + System.getProperty("user.dir"));
|
||||||
//long elapsedTime = end - start;
|
File result = new File("./testdocuments/output/heading_with_page_break_before.html");
|
||||||
//System.out.println(elapsedTime/1000000);
|
File model = new File("./testdocuments/model/heading_with_page_break_before.html");
|
||||||
|
// System.out.println(result.exists());
|
||||||
|
// System.out.println(model.exists());
|
||||||
|
assertTrue( FileUtils.contentEquals(result, model),"The files differ!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
testdocuments/input/heading_with_page_break_before.odt
Normal file
BIN
testdocuments/input/heading_with_page_break_before.odt
Normal file
Binary file not shown.
24
testdocuments/model/heading_with_page_break_before.html
Normal file
24
testdocuments/model/heading_with_page_break_before.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru-RU" xml:lang="ru-RU" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>Default</title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<style media="all" type="text/css">
|
||||||
|
body {margin-left:auto;max-width:800px;font-size:1.0rem;font-family:'IPH Lib Serif';margin-right:auto;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body dir="ltr">
|
||||||
|
<div class="pageNum" page="1">
|
||||||
|
<div class="pageContainer" style="column-count: 1;">
|
||||||
|
<p class="Textbody" style="margin-left:0;border:none;padding:0;text-indent:2.1259842rem;font-size:1.0rem;margin-top:0;font-family:'IPH Astra Serif',serif;margin-bottom:0.58346456rem;margin-right:0;">BEFORE HEADING</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pageBreak" style="height:3em;margin-top:1em;margin-bottom:1em;background-color:red;"> </div>
|
||||||
|
<div class="pageNum" page="2">
|
||||||
|
<div class="pageContainer" style="column-count: 1;">
|
||||||
|
<h1 id="toc0" style="margin-left:0;border:none;padding:0;font-weight:bold;clear:left;font-size:1.5166668rem;margin-top:0.9992126rem;font-family:'IPH Astra Serif',serif;page-break-before:always;margin-bottom:0.5007874rem;margin-right:0;text-align:center;">Heading</h1>
|
||||||
|
<p class="Textbody" style="margin-left:0;border:none;padding:0;text-indent:2.1259842rem;font-size:1.0rem;margin-top:0;font-family:'IPH Astra Serif',serif;margin-bottom:0.58346456rem;margin-right:0;"><span style="font-size:8.0rem;font-family:'IPH Astra Serif',serif;">Tex</span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Reference in a new issue