chore: removed dependency

This commit is contained in:
Georgy Litvinov 2021-12-08 15:41:43 +01:00
parent 19b17c5b58
commit a6e85d367a
No known key found for this signature in database
GPG key ID: E8185E06DE0279DD
17 changed files with 66 additions and 31 deletions

View file

@ -29,7 +29,6 @@ configurations{
regressionTestsImplementation.extendsFrom compileClasspath
}
dependencies{
regressionTestsImplementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.1'
regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1'
regressionTestsImplementation 'org.junit.jupiter:junit-jupiter-engine'

View file

@ -6,7 +6,6 @@ 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;
@ -25,6 +24,6 @@ public class PageBreaksBeforeHeading {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/heading_with_page_break_before.html");
File model = new File("./testdocuments/model/heading_with_page_break_before.html");
assertTrue( FileUtils.contentEquals(result, model),"The files differ!");
assertTrue( TestFiles.equals(result, model),"The files differ!");
}
}

View file

@ -0,0 +1,23 @@
package w2phtml.regressionTests;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Arrays;
public class TestFiles {
public static boolean equals(File file1, File file2) {
byte[] f1;
byte[] f2;
try {
f1 = Files.readAllBytes(file1.toPath());
f2 = Files.readAllBytes(file2.toPath());
return Arrays.equals(f1, f2);
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
}

View file

@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import w2phtml.regressionTests.TestFiles;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.DisplayName;
@ -26,6 +27,6 @@ public class BreakAfterTest {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/" + name + ".html");
File model = new File("./testdocuments/model/" + name + ".html");
assertTrue(FileUtils.contentEquals(result, model), "The files differ!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class BulletList {
@Test
@DisplayName("List on multiple pages")
@ -26,6 +27,6 @@ public class BulletList {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/" + name + ".html");
File model = new File("./testdocuments/model/" + name + ".html");
assertTrue(FileUtils.contentEquals(result, model), "The files differ!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class GreenstoneHeadings {
@Test
@DisplayName("Greenstone3 tags headings")
@ -25,6 +26,6 @@ public class GreenstoneHeadings {
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!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class HardPageBreaksInLists {
@Test
@DisplayName("Hard page breaks inside list")
@ -26,6 +27,6 @@ public class HardPageBreaksInLists {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/" + name + ".html");
File model = new File("./testdocuments/model/" + name + ".html");
assertTrue(FileUtils.contentEquals(result, model), "The files differ!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class HeadingWithSections {
@Test
@DisplayName("Heading with sections")
@ -24,6 +25,6 @@ public class HeadingWithSections {
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!");
assertTrue(TestFiles.equals(result, model),"The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class ImageAfterSection {
@Test
@DisplayName("image after section")
@ -24,6 +25,6 @@ public class ImageAfterSection {
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!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class ListAfterText {
@Test
@DisplayName("List after soft page break")
@ -26,6 +27,6 @@ public class ListAfterText {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/" + name + ".html");
File model = new File("./testdocuments/model/" + name + ".html");
assertTrue(FileUtils.contentEquals(result, model), "The files differ!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class ListInSection {
@Test
@DisplayName("List in section")
@ -26,6 +27,6 @@ public class ListInSection {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/" + name + ".html");
File model = new File("./testdocuments/model/" + name + ".html");
assertTrue(FileUtils.contentEquals(result, model), "The files differ!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class ListInTable {
@Test
@DisplayName("list in table")
@ -24,6 +25,6 @@ public class ListInTable {
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!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class ListTableSection {
@Test
@DisplayName("list in table in section")
@ -24,6 +25,6 @@ public class ListTableSection {
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!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class PageStartWith10 {
@Test
@DisplayName("start page from 10 in section")
@ -24,6 +25,6 @@ public class PageStartWith10 {
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!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class PageStartWith10InSection {
@Test
@DisplayName("start page from 10")
@ -24,6 +25,6 @@ public class PageStartWith10InSection {
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!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class SoftPageBreakInListTest {
@Test
@DisplayName("Soft page break in list")
@ -26,6 +27,6 @@ public class SoftPageBreakInListTest {
w2phtml.Application.main(arguments.toArray(new String[0]));
File result = new File("./testdocuments/output/" + name + ".html");
File model = new File("./testdocuments/model/" + name + ".html");
assertTrue(FileUtils.contentEquals(result, model), "The files differ!");
assertTrue(TestFiles.equals(result, model), "The files differ!");
}
}

View file

@ -6,10 +6,11 @@ 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;
import w2phtml.regressionTests.TestFiles;
public class SplitFilesAlignToPages {
@Test
@DisplayName("Split files align to pages")
@ -28,8 +29,8 @@ public class SplitFilesAlignToPages {
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!");
assertTrue(TestFiles.equals(result1, model1), "The files differ!");
assertTrue(TestFiles.equals(result2, model2), "The files differ!");
}
}