}
protected void invokeApplication() throws Exception {
assert Conversation.instance().isLongRunning();
DirectoryHome dirHome = (DirectoryHome)getInstance(DirectoryHome.class);
assert dirHome.getInstance().getId().equals(3l); // Init!
assert dirHome.getMenuItems().size() == 1;
assert dirHome.getAvailableMenuItems().size() == 1;
WikiDirectory newMenuItem = dirHome.getAvailableMenuItems().iterator().next();
dirHome.setSelectedChildDirectory(newMenuItem);
dirHome.addMenuItem();
assert dirHome.getMenuItems().size() == 2;
assert invokeMethod("#{directoryHome.update}").equals("updated");
}
protected void renderResponse() throws Exception {
DirectoryHome dirHome = (DirectoryHome)getInstance(DirectoryHome.class);
assert dirHome.getMenuItems().size() == 2;
WikiMenuItem[] menuItems = dirHome.getMenuItems().toArray(new WikiMenuItem[dirHome.getMenuItems().size()]);
assert menuItems[0].getDirectoryId().equals(4l);
assert menuItems[0].getDirectory().getId().equals(4l);
assert menuItems[0].getDisplayPosition() == 0;
assert menuItems[1].getDirectoryId().equals(5l);
assert menuItems[1].getDirectory().getId().equals(5l);