Wikipedia implements WikiConstants { public Iterable<Category> getCategories() { return new CategoryIterable(this); } Wikipedia(DatabaseConfiguration dbConfig); Page getPage(String title); Page getPageByExactTitle(String exactTitle); Set<Page> getPages(String title); Page getPage(int pageId); Title getTitle(int pageId); List<Integer> getPageIds(String title); List<Integer> getPageIdsCaseInsensitive(String title); Page getArticleForDiscussionPage(Page discussionPage); Page getDiscussionPage(int articlePageId); Page getDiscussionPage(String title); Page getDiscussionPage(Page articlePage); Iterable<Page> getDiscussionArchives(int articlePageId); Iterable<Page> getDiscussionArchives(String title); Iterable<Page> getDiscussionArchives(Page articlePage); Category getCategory(String title); Category getCategory(int pageId); Iterable<Category> getCategories(); Set<Category> getCategories(String pageTitle); Iterable<Page> getPages(); Iterable<Integer> getPageIds(); Iterable<Page> getPages(PageQuery query); Iterable<Page> getArticles(); Iterable<Title> getTitles(); Language getLanguage(); boolean existsPage(String title); boolean existsPage(int pageID); MetaData getMetaData(); DatabaseConfiguration getDatabaseConfiguration(); String getWikipediaId();  }
@Test public void testGetCategoriesByPageTitleInvalid1() { try { wiki.getCategories(""); } catch (WikiPageNotFoundException wpnfe) { } catch (RuntimeException re) { fail("Expected a WikiPageNotFoundException, yet encountered RuntimeException: " + re.getLocalizedMessage()); } }
@Test public void testGetCategoriesByPageTitleInvalid2() { try { wiki.getCategories(null); } catch (WikiPageNotFoundException wpnfe) { } catch (RuntimeException re) { fail("Expected a WikiPageNotFoundException, yet encountered RuntimeException: " + re.getLocalizedMessage()); } }