Package org.jboss.seam.wiki.core.action

Examples of org.jboss.seam.wiki.core.action.DirectoryBrowser


            protected void renderResponse() throws Exception {
                WikiDocument doc = (WikiDocument)getValue("#{currentDocument}");
                assert doc == null;

                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                WikiDirectory dir = browser.getInstance();
                assert dir != null;
                assert dir.getId().equals(4l);

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

                assert browser.isRemovable(browser.getChildNodes().get(0));

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


            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(6l);

                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(6l) == null;

                assert dao.findWikiComment(10l) == null;
View Full Code Here

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

            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(30l);

                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(30l) == null;

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

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

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

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

                boolean found = false;
                for (WikiNode node : browser.getChildNodes()) if (node.getId().equals(9l)) found = true;
                assert found;

                DocumentHome docHome = (DocumentHome)getInstance(DocumentHome.class);
                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");
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.core.action.DirectoryBrowser

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.