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
}