mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-11 08:08:46 -04:00
Separate how we test Library from how we create it.
This commit is contained in:
parent
089a7d4ba5
commit
ddbf5a08c5
@ -198,13 +198,8 @@ public class test {
|
|||||||
archive.dispose();
|
archive.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
private void testLibrary(TestLibrary lib)
|
||||||
public void testLibrary()
|
|
||||||
throws IOException {
|
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);
|
assertEquals(lib.getBookCount(true, true), 1);
|
||||||
String[] bookIds = lib.getBooksIds();
|
String[] bookIds = lib.getBooksIds();
|
||||||
assertEquals(bookIds.length, 1);
|
assertEquals(bookIds.length, 1);
|
||||||
@ -246,6 +241,15 @@ public class test {
|
|||||||
assertEquals(bookIds.length, 0);
|
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
|
@Test
|
||||||
public void testServer() throws ZimFileFormatException, JNIKiwixException {
|
public void testServer() throws ZimFileFormatException, JNIKiwixException {
|
||||||
TestArchive archive = new TestArchive("small.zim");
|
TestArchive archive = new TestArchive("small.zim");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user