@@ -134,6 +134,7 @@ public void testArchiveWithAnEmbeddedArchive()
134134 assertEquals (true , archive .hasIllustration (48 ));
135135 Item item = archive .getIllustrationItem (48 );
136136 assertEquals (faviconData .length , item .getSize ());
137+ assertEquals (new String (faviconData ), item .getData ().getData ());
137138
138139 DirectAccessInfo dai = archive .getEntryByPath ("I/favicon.png" ).getItem (true ).getDirectAccessInformation ();
139140 assertNotEquals ("" , dai .filename );
@@ -155,6 +156,12 @@ public void testLibrary()
155156 assertEquals (bookIds .length , 1 );
156157 lib .filter (new Filter ().local (true ));
157158
159+ Book book = lib .getBookById (bookIds [0 ]);
160+ assertEquals (book .getTitle (), "Test ZIM file" );
161+ assertEquals (book .getTags (), "unit;test" );
162+ assertEquals (book .getIllustration (48 ).url (), "http://localhost/meta?name=favicon&content=small" );
163+ assertEquals (book .getUrl (), "http://localhost/small.zim" );
164+
158165 // remove book from library by id
159166 lib .removeBookById (bookIds [0 ]);
160167 bookIds = lib .getBooksIds ();
@@ -204,7 +211,23 @@ public void testBookMark() throws ZimFileFormatException, JNIKiwixException {
204211 @ Test
205212 public void testSearcher () throws Exception , ZimFileFormatException , JNIKiwixException {
206213 Archive archive = new Archive ("small.zim" );
214+
207215 Searcher searcher = new Searcher (archive );
216+ Query query = new Query ("test" );
217+ Search search = searcher .search (query );
218+ int estimatedMatches = (int ) search .getEstimatedMatches ();
219+ assertEquals (1 , estimatedMatches );
220+ SearchIterator iterator = search .getResults (0 , estimatedMatches );
221+ searcher .dispose ();
222+
223+ SuggestionSearcher suggestionSearcher = new SuggestionSearcher (archive );
224+ SuggestionSearch suggestionSearch = suggestionSearcher .suggest ("test" );
225+ int matches = (int ) suggestionSearch .getEstimatedMatches ();
226+ assertEquals (1 , matches );
227+ SuggestionIterator results = suggestionSearch .getResults (1 , matches );
228+ SuggestionItem suggestionItem = results .next ();
229+ assertEquals ("Test ZIM file" , suggestionItem .getTitle ());
230+ suggestionSearcher .dispose ();
208231 }
209232
210233 static
0 commit comments