assertEquals(1, pageContent.getNamespaceContents().size());
}
@Test
public void testLoadTopLevelNamespace() throws Exception {
final TreeNode newContent = new DefaultTreeNode();
newContent.setSelected(false);
final TreeNode selectedNode = new DefaultTreeNode();
selectedNode.setSelected(true);
final List<Content> contentList = new ArrayList<Content>();
contentList.add(new Content());
new NonStrictExpectations() {{
facesContext.getPartialViewContext(); result = partialViewContext;
partialViewContext.isAjaxRequest(); result = false;
theTree.getContentHolder(); result = contentHolder;
contentHolder.find(new ContentKey(null, "namespace", "namespace")); result = newContent;
theTree.getSelectedNode(); result = selectedNode;
pageContent.getNamespace(); result = Namespace.createFromString("net");
pageContent.getNamespaceContents(); result = new Vector<BaseContent>();
theTree.getContentManager(); result = contentManager;
contentManager.loadContent((Namespace) any); result = contentList;
contentManager.loadChildNamespaces((Namespace) any); result = Collections.emptyList();
}};
pageContent.setNamespaceContents(new ArrayList<BaseContent>());
adminController.setIncomingNamespace("namespace");
adminController.pageContent = new PageContent();
adminController.pageContent.setTheContent(Namespace.createFromString("net"));
adminController.loadNamespace();
assertTrue(newContent.isSelected());
assertFalse(selectedNode.isSelected());
assertEquals(2, pageContent.getNamespaceContents().size());
}