new FacesRequest() {
protected void invokeApplication() throws Exception {
WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
WikiDirectory forums = nodeDAO.findWikiDirectory(100l);
ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);
Calendar lastLogin = new GregorianCalendar(2007, 2, 1);
Map<Long, Long> unreadTopics = dao.findUnreadTopicAndParentIds(forums, lastLogin.getTime());
assert unreadTopics.size() == 3;
assert unreadTopics.get(111l).equals(109l);
assert unreadTopics.get(107l).equals(102l);
assert unreadTopics.get(104l).equals(102l);
lastLogin = new GregorianCalendar(2007, 3, 5);
unreadTopics = dao.findUnreadTopicAndParentIds(forums, lastLogin.getTime());
assert unreadTopics.size() == 2;
assert unreadTopics.get(111l).equals(109l);
assert unreadTopics.get(104l).equals(102l);
}