mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-10 07:36:26 -04:00
Added test cases for checking is archive created with invalid zim file , added remove book from library by id tests
This commit is contained in:
parent
bea92d800d
commit
d6e4479621
@ -71,6 +71,15 @@ public class test {
|
|||||||
assertEquals(new String(faviconData), c);
|
assertEquals(new String(faviconData), c);
|
||||||
|
|
||||||
archive.dispose();
|
archive.dispose();
|
||||||
|
|
||||||
|
// test reader with invalid zim file
|
||||||
|
String zimFile = "test.zim";
|
||||||
|
try {
|
||||||
|
Archive archive1 = new Archive(zimFile);
|
||||||
|
fail("ERROR: Archive created with invalid Zim file!");
|
||||||
|
} catch (ZimFileFormatException zimFileFormatException) {
|
||||||
|
assertEquals("Cannot open zimfile " + zimFile, zimFileFormatException.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -145,6 +154,11 @@ public class test {
|
|||||||
String[] bookIds = lib.getBooksIds();
|
String[] bookIds = lib.getBooksIds();
|
||||||
assertEquals(bookIds.length, 1);
|
assertEquals(bookIds.length, 1);
|
||||||
lib.filter(new Filter().local(true));
|
lib.filter(new Filter().local(true));
|
||||||
|
|
||||||
|
// remove book from library by id
|
||||||
|
lib.removeBookById(bookIds[0]);
|
||||||
|
bookIds = lib.getBooksIds();
|
||||||
|
assertEquals(bookIds.length, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user