Package org.jboss.seam.wiki.plugin.forum

Examples of org.jboss.seam.wiki.plugin.forum.ForumDAO


        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(100l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);

                Map<Long, ForumInfo> forums = dao.findForums(forumDir);

                assert forums.size() == 1;
                assert forums.get(102l).getForum().getId().equals(102l);
            }
        }.run();
View Full Code Here


        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(100l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);

                Map<Long, ForumInfo> forums = dao.findForums(forumDir);

                assert forums.size() == 2;
                assert forums.get(102l).getForum().getId().equals(102l);
                assert forums.get(109l).getForum().getId().equals(109l);
            }
View Full Code Here

        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(100l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);

                Map<Long, ForumInfo> infos = dao.findForums(forumDir);
                assert infos.size() == 2;

                assert infos.get(102l).getTotalNumOfTopics() == 2;
                assert infos.get(102l).getTotalNumOfPosts() == 5;
                assert infos.get(102l).getLastTopic().getId().equals(107l);
View Full Code Here

        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);
            }
View Full Code Here

        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forum = nodeDAO.findWikiDirectory(102l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);

                Calendar lastLogin = new GregorianCalendar(2007, 2, 1);
                Map<Long, Long> unreadTopics = dao.findUnreadTopicAndParentIdsInForum(forum, lastLogin.getTime());

                assert unreadTopics.size() == 2;
                assert unreadTopics.get(107l).equals(102l);
                assert unreadTopics.get(104l).equals(102l);

                lastLogin = new GregorianCalendar(2007, 3, 5);
                unreadTopics = dao.findUnreadTopicAndParentIdsInForum(forum, lastLogin.getTime());

                assert unreadTopics.size() == 1;
                assert unreadTopics.get(104l).equals(102l);
            }
        }.run();
View Full Code Here

        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forum = nodeDAO.findWikiDirectory(102l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);
                assert dao.findTopicCount(forum).equals(2l);

                forum = nodeDAO.findWikiDirectory(109l);
                assert dao.findTopicCount(forum).equals(1l);

            }
        }.run();

    }
View Full Code Here

        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forum = nodeDAO.findWikiDirectory(102l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);

                Map<Long, TopicInfo> topics = dao.findTopics(forum, 0, 10);

                assert topics.size() == 2;

                assert topics.get(107l).getTopic().getId().equals(107l);
                assert topics.get(107l).getNumOfReplies() == 1l;
View Full Code Here

        new FacesRequest() {
            protected void invokeApplication() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forum = nodeDAO.findWikiDirectory(109l);

                ForumDAO dao = (ForumDAO)getInstance(ForumDAO.class);

                Map<Long, TopicInfo> topics = dao.findTopics(forum, 0, 10);

                assert topics.size() == 1;

                assert topics.get(111l).getTopic().getId().equals(111l);
                assert topics.get(111l).getNumOfReplies() == 0l;
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.plugin.forum.ForumDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.