Separate how we test Library from how we create it.

This commit is contained in:
Matthieu Gautier 2023-06-21 16:46:37 +02:00
parent 089a7d4ba5
commit ddbf5a08c5

View File

@ -198,13 +198,8 @@ public class test {
archive.dispose();
}
@Test
public void testLibrary()
private void testLibrary(TestLibrary lib)
throws IOException {
TestLibrary lib = new TestLibrary();
TestManager manager = new TestManager(lib);
String content = getTextFileContent("catalog.xml");
manager.readOpds(content, "http://localhost");
assertEquals(lib.getBookCount(true, true), 1);
String[] bookIds = lib.getBooksIds();
assertEquals(bookIds.length, 1);
@ -246,6 +241,15 @@ public class test {
assertEquals(bookIds.length, 0);
}
@Test
public void testLibraryOPDS() throws IOException {
TestLibrary lib = new TestLibrary();
TestManager manager = new TestManager(lib);
String content = getTextFileContent("catalog.xml");
manager.readOpds(content, "http://localhost");
testLibrary(lib);
}
@Test
public void testServer() throws ZimFileFormatException, JNIKiwixException {
TestArchive archive = new TestArchive("small.zim");