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

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


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

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

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(9l);

                browser.getSelectedNodes().put(doc, true);

                browser.copy();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(9l);
                assert !clipboard.isCut(9l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;
               
                DirectoryBrowser browser = (DirectoryBrowser)getInstance(DirectoryBrowser.class);
                assert browser.getInstance().getId().equals(4l); // Init!

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

                WikiDocument doc =
                        browser.getWikiNodeDAO().findWikiDocumentInArea(browser.getInstance().getAreaNumber(), "Four");

                assert doc.getAreaNumber().equals(browser.getInstance().getAreaNumber());

                WikiDocument docOriginal =
                        browser.getWikiNodeDAO().findWikiDocumentInArea(2l, "Four");

                assert docOriginal.getParent().getId().equals(2l);
            }
        }.run();
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!

                WikiUpload upload = browser.getWikiNodeDAO().findWikiUpload(30l);

                browser.getSelectedNodes().put(upload, true);

                browser.copy();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(30l);
                assert !clipboard.isCut(30l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                List<WikiUpload> uploads = browser.getWikiNodeDAO().findWikiUploads(browser.getInstance(), WikiNode.SortableProperty.createdOn, true);

                assert uploads.size() == 1;
                assert uploads.get(0).getName().equals("Test Image");
                assert uploads.get(0).getAreaNumber().equals(browser.getInstance().getAreaNumber());

                WikiDirectory originalDir = browser.getWikiNodeDAO().findWikiDirectory(2l);
                List<WikiUpload> originalUploads = browser.getWikiNodeDAO().findWikiUploads(originalDir, WikiNode.SortableProperty.createdOn, true);
                assert originalUploads.size() == 2;
            }
        }.run();

    }
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!

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(9l);
                WikiUpload upload = browser.getWikiNodeDAO().findWikiUpload(30l);

                browser.getSelectedNodes().put(doc, true);
                browser.getSelectedNodes().put(upload, true);

                browser.copy();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 2;
                assert !clipboard.isCut(9l);
                assert !clipboard.isCut(30l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                WikiDocument doc =
                        browser.getWikiNodeDAO().findWikiDocumentInArea(browser.getInstance().getAreaNumber(), "Four");

                assert doc.getAreaNumber().equals(browser.getInstance().getAreaNumber());

                List<WikiUpload> uploads = browser.getWikiNodeDAO().findWikiUploads(browser.getInstance(), WikiNode.SortableProperty.createdOn, true);

                assert uploads.size() == 1;
                assert uploads.get(0).getName().equals("Test Image");
                assert uploads.get(0).getAreaNumber().equals(browser.getInstance().getAreaNumber());

                WikiDirectory originalDir = browser.getWikiNodeDAO().findWikiDirectory(2l);
                List<WikiUpload> originalUploads = browser.getWikiNodeDAO().findWikiUploads(originalDir, WikiNode.SortableProperty.createdOn, true);
                assert originalUploads.size() == 2;
            }
        }.run();

    }
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!

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(9l);

                browser.getSelectedNodes().put(doc, true);

                browser.cut();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(9l);
                assert clipboard.isCut(9l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocumentInArea(browser.getInstance().getAreaNumber(), "Four");
                assert doc.getAreaNumber().equals(browser.getInstance().getAreaNumber());

                WikiDocument docOriginal = browser.getWikiNodeDAO().findWikiDocumentInArea(2l, "Four");
                assert docOriginal == null;
            }
        }.run();

    }
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!

                WikiUpload upload = browser.getWikiNodeDAO().findWikiUpload(30l);

                browser.getSelectedNodes().put(upload, true);

                browser.cut();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(30l);
                assert clipboard.isCut(30l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                List<WikiUpload> uploads = browser.getWikiNodeDAO().findWikiUploads(browser.getInstance(), WikiNode.SortableProperty.createdOn, true);

                assert uploads.size() == 1;
                assert uploads.get(0).getName().equals("Test Image");
                assert uploads.get(0).getAreaNumber().equals(browser.getInstance().getAreaNumber());

                WikiDirectory originalDir = browser.getWikiNodeDAO().findWikiDirectory(2l);
                List<WikiUpload> originalUploads = browser.getWikiNodeDAO().findWikiUploads(originalDir, WikiNode.SortableProperty.createdOn, true);
                assert originalUploads.size() == 1;
            }
        }.run();

    }
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!

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(9l);
                WikiUpload upload = browser.getWikiNodeDAO().findWikiUpload(30l);

                browser.getSelectedNodes().put(doc, true);
                browser.getSelectedNodes().put(upload, true);

                browser.cut();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 2;

                assert clipboard.isCut(9l);
                assert clipboard.isCut(30l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                WikiDocument doc =
                        browser.getWikiNodeDAO().findWikiDocumentInArea(browser.getInstance().getAreaNumber(), "Four");

                assert doc.getAreaNumber().equals(browser.getInstance().getAreaNumber());

                List<WikiUpload> uploads = browser.getWikiNodeDAO().findWikiUploads(browser.getInstance(), WikiNode.SortableProperty.createdOn, true);

                assert uploads.size() == 1;
                assert uploads.get(0).getName().equals("Test Image");
                assert uploads.get(0).getAreaNumber().equals(browser.getInstance().getAreaNumber());

                WikiDocument docOriginal = browser.getWikiNodeDAO().findWikiDocumentInArea(2l, "Four");
                assert docOriginal == null;

                WikiDirectory originalDir = browser.getWikiNodeDAO().findWikiDirectory(2l);
                List<WikiUpload> originalUploads = browser.getWikiNodeDAO().findWikiUploads(originalDir, WikiNode.SortableProperty.createdOn, true);
                assert originalUploads.size() == 1;
            }
        }.run();

    }
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!

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(9l);

                browser.getSelectedNodes().put(doc, true);

                browser.cut();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(9l);
                assert clipboard.isCut(9l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocumentInArea(browser.getInstance().getAreaNumber(), "Four");
                assert doc.getAreaNumber().equals(browser.getInstance().getAreaNumber());
                assert doc.getId().equals(9l);
            }
        }.run();

    }
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!

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(9l);

                browser.getSelectedNodes().put(doc, true);

                browser.copy();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(9l);
                assert !clipboard.isCut(9l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

                assert browser.getChildNodes().size() == 4;
            }
        }.run();

    }
View Full Code Here

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

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

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(6l);

                browser.getSelectedNodes().put(doc, true);

                browser.cut();
            }

        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);

                assert clipboard.getItems().size() == 1;
                assert clipboard.getItemsAsList().get(0).equals(6l);
                assert clipboard.isCut(6l);
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

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

                browser.paste();

                browser.getEntityManager().flush(); // TODO: ?! I think the test phase listener is wrong here not doing that...
            }
        }.run();

        new FacesRequest("/dirDisplay_d.xhtml") {

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

            protected void renderResponse() throws Exception {
                Clipboard clipboard = (Clipboard)getInstance(Clipboard.class);
                assert clipboard.getItems().size() == 0;

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

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

                WikiDocument docOriginal = browser.getWikiNodeDAO().findWikiDocumentInArea(3l, "One");
                assert docOriginal == null;

                WikiDirectory dirOriginal = browser.getWikiNodeDAO().findWikiDirectory(3l);
                assert dirOriginal.getDefaultFile() == null;

                WikiDocument doc = browser.getWikiNodeDAO().findWikiDocument(6l);
                assert doc.getAreaNumber().equals(2l);
                assert doc.getParent().getId().equals(2l);

                List<WikiComment> comments = browser.getWikiNodeDAO().findWikiComments(doc, false);
                for (WikiComment comment : comments) {
                    assert comment.getAreaNumber().equals(2l);
                }
               
            }
View Full Code Here

            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(2l);
                assert dir.getArea().getId().equals(2l);

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

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

                assert getRenderedViewId().equals("/dirDisplay_d.xhtml");
            }
        }.run();
    }
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.