Skip to content

Commit ddbf5a0

Browse files
committed
Separate how we test Library from how we create it.
1 parent 089a7d4 commit ddbf5a0

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

lib/src/test/test.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,8 @@ public void testArchiveWithAnEmbeddedArchive()
198198
archive.dispose();
199199
}
200200

201-
@Test
202-
public void testLibrary()
201+
private void testLibrary(TestLibrary lib)
203202
throws IOException {
204-
TestLibrary lib = new TestLibrary();
205-
TestManager manager = new TestManager(lib);
206-
String content = getTextFileContent("catalog.xml");
207-
manager.readOpds(content, "http://localhost");
208203
assertEquals(lib.getBookCount(true, true), 1);
209204
String[] bookIds = lib.getBooksIds();
210205
assertEquals(bookIds.length, 1);
@@ -246,6 +241,15 @@ public void testLibrary()
246241
assertEquals(bookIds.length, 0);
247242
}
248243

244+
@Test
245+
public void testLibraryOPDS() throws IOException {
246+
TestLibrary lib = new TestLibrary();
247+
TestManager manager = new TestManager(lib);
248+
String content = getTextFileContent("catalog.xml");
249+
manager.readOpds(content, "http://localhost");
250+
testLibrary(lib);
251+
}
252+
249253
@Test
250254
public void testServer() throws ZimFileFormatException, JNIKiwixException {
251255
TestArchive archive = new TestArchive("small.zim");

0 commit comments

Comments
 (0)