Category implements WikiConstants { public int getPageId() { Session session = this.wiki.__getHibernateSession(); session.beginTransaction(); session.lock(hibernateCategory, LockMode.NONE); int pageID = hibernateCategory.getPageId(); session.getTransaction().commit(); return pageID; } protected  Category(Wikipedia wiki, long id); protected  Category(Wikipedia wiki, int pageID);  Category(Wikipedia wiki, String pName); int getPageId(); Set<Category> getParents(); int getNumberOfParents(); Set<Integer> getParentIDs(); Set<Category> getChildren(); int getNumberOfChildren(); Set<Integer> getChildrenIDs(); Title getTitle(); Set<Page> getArticles(); Set<Integer> getArticleIds(); int getNumberOfPages(); Iterable <Category> getDescendants(); Set<Category> getSiblings();  }
@Test public void testCategoryPageId(){ Category cat; try { cat = wiki.getCategory(A_FAMOUS_CATEGORY); assertNotNull(cat); assertEquals("testing the pageId",8,cat.getPageId()); } catch (WikiApiException e) { fail("A WikiApiException occurred while getting the category 'People of UKP': " + e.getLocalizedMessage()); } }
@Test public void testCreateCategoryByPageID() { try { Category p = new Category(wiki, A_FAMOUS_PAGE_ID); assertNotNull(p); assertEquals(A_FAMOUS_PAGE_ID, p.getPageId()); } catch (WikiApiException e) { fail("A WikiApiException occurred creating a page: " + e.getLocalizedMessage()); } }