Package org.jboss.seam.wiki.core.dao

Examples of org.jboss.seam.wiki.core.dao.WikiNodeDAO


            protected void renderResponse() throws Exception {
                WikiFile newFile = (WikiFile)getValue("#{documentHome.instance}");

                // Shouldn't have any historical data
                WikiNodeDAO wikiNodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                assert wikiNodeDAO.findHistoricalFiles(newFile).size() == 0;
                assert wikiNodeDAO.findNumberOfHistoricalFiles(newFile).equals(0l);
            }

        }.run();
    }
View Full Code Here


                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                assert browser.getChildNodes().size() == 0;

                WikiNodeDAO dao = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                assert dao.findWikiNode(6l) == null;

                assert dao.findWikiComment(10l) == null;
                assert dao.findWikiComment(11l) == null;
                assert dao.findWikiComment(12l) == null;
                assert dao.findWikiComment(13l) == null;
                assert dao.findWikiComment(14l) == null;
                assert dao.findWikiComment(15l) == null;

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");

                // Comments should be gone
            }
View Full Code Here

                assert invokeMethod("#{documentHome.remove}").equals("removed");
            }

            // Feed entries should be gone
            protected void renderResponse() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDocument document = nodeDAO.findWikiDocument(9l);

                FeedDAO feedDAO = (FeedDAO)getInstance(FeedDAO.class);

                List<WikiFeed> feeds = feedDAO.findFeeds(document);
                assert feeds.size() == 0;
            }
        }.run();

        loginAdmin();

        new NonFacesRequest("/wiki.xhtml") {

            protected void beforeRequest() {
                setParameter("areaName", "Trash");
            }

            protected void renderResponse() throws Exception {
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                assert browser.getChildNodes().size() == 1;
                assert browser.getChildNodes().get(0).getId().equals(9l);

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

            protected void beforeRequest() {
                setParameter("directoryId", "17");
            }

            protected void invokeApplication() throws Exception {
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                browser.emptyTrash();
            }
        }.run();

        new NonFacesRequest("/wiki.xhtml") {

            protected void beforeRequest() {
                setParameter("areaName", "Trash");
            }

            protected void renderResponse() throws Exception {
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                assert browser.getChildNodes().size() == 0;

                WikiNodeDAO dao = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                assert dao.findWikiNode(9l) == null;

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");

                // Comments should be gone
            }
View Full Code Here

                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                assert browser.getChildNodes().size() == 0;

                WikiNodeDAO dao = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                assert dao.findWikiNode(30l) == null;

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");
            }
        }.run();
    }
View Full Code Here

                assert docHome.remove(9l).equals("removed");
            }

            // Feed entries should be gone
            protected void renderResponse() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDocument document = nodeDAO.findWikiDocument(9l);

                FeedDAO feedDAO = (FeedDAO)getInstance(FeedDAO.class);

                List<WikiFeed> feeds = feedDAO.findFeeds(document);
                assert feeds.size() == 0;
            }
        }.run();

        loginAdmin();

        new NonFacesRequest("/wiki.xhtml") {

            protected void beforeRequest() {
                setParameter("areaName", "Trash");
            }

            protected void renderResponse() throws Exception {
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                assert browser.getChildNodes().size() == 1;
                assert browser.getChildNodes().get(0).getId().equals(9l);

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

            protected void beforeRequest() {
                setParameter("directoryId", "17");
            }

            protected void invokeApplication() throws Exception {
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                browser.emptyTrash();
            }
        }.run();

        new NonFacesRequest("/wiki.xhtml") {

            protected void beforeRequest() {
                setParameter("areaName", "Trash");
            }

            protected void renderResponse() throws Exception {
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(17l); // Init!

                assert browser.getChildNodes().size() == 0;

                WikiNodeDAO dao = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                assert dao.findWikiNode(9l) == null;

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");

            }
        }.run();
View Full Code Here

                    fileId = Long.valueOf(id);
                } catch (NumberFormatException ex) {
                    response.sendError(HttpServletResponse.SC_NOT_FOUND, "File" + id);
                }

                WikiNodeDAO wikiNodeDAO = (WikiNodeDAO)org.jboss.seam.Component.getInstance(WikiNodeDAO.class);
                file = wikiNodeDAO.findWikiUpload(fileId);
            }

            String contentType = null;
            byte[] data = null;
View Full Code Here

            protected void beforeRequest() {
                setParameter("documentId", "6");
            }

            protected void renderResponse() throws Exception {
                WikiNodeDAO dao = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                assert dao.findWikiNode(12l).getRating() == 4;
            }

        }.run();

    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.core.dao.WikiNodeDAO

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.