FileTreeNode data = null;
TreeNodeElement<FileTreeNode> parentTreeNode = tree.getNode(tree.getModel().getRoot());
expectMockWorkspaceInfo("Mock Workspace");
controller.handleDownload(parentTreeNode, true);
Element iframe =
Elements.getDocument().getElementById(FileTreeContextMenuController.DOWNLOAD_FRAME_ID);
assertFalse(iframe == null);
String url = ((IFrameElement) iframe).getSrc();
assertTrue("Bad url: " + url, url.contains("/Mock_Workspace.zip?rt=zip&"));
assertTrue("Bad url: " + url, url.endsWith("&file=/"));
iframe.removeFromParent();
controller.handleDownload(null, true);
iframe = Elements.getDocument().getElementById(FileTreeContextMenuController.DOWNLOAD_FRAME_ID);
assertFalse(iframe == null);
url = ((IFrameElement) iframe).getSrc();
assertTrue("Bad url: " + url, url.contains("/Mock_Workspace.zip?rt=zip&"));
assertTrue("Bad url: " + url, url.endsWith("&file=/"));
iframe.removeFromParent();
}