private void appendToNode(JTree jTree, InvDataset dataset, MutableTreeNode parentNode) { final DefaultTreeModel treeModel = (DefaultTreeModel) jTree.getModel(); if (dataset instanceof InvCatalogRef) { CatalogTreeUtils.appendCatalogNode(parentNode, treeModel, (InvCatalogRef) dataset); } else { appendLeafNode(parentNode, treeModel, dataset); } }
@Test public void testAppendDatasetWhichHasDapAccessAndAlsoFileAccess() throws URISyntaxException { // preparation final String dapServiceName = "OPENDAP"; final String fileServiceName = "FILE"; final InvDatasetImpl dapDataset = createDataset(new String[]{fileServiceName, dapServiceName}); // execution new CatalogTree(null, new DefaultAppContext(""), null).appendLeafNode(parentNode, getDefaultTreeModel(), dapDataset); // verification testThatChildIsDapNodeWhichHasFileAccessToo(parentNode); }
@Test public void testAppendAn_OPeNDAP_Node() throws URISyntaxException { // preparation final String serviceType = "OPENDAP"; final InvDatasetImpl dapDataset = createDataset(new String[]{serviceType}); // execution new CatalogTree(null, new DefaultAppContext(""), null).appendLeafNode(parentNode, getDefaultTreeModel(), dapDataset); // verification testThatChildIsOnlyDapNodeWithoutFileAccess(parentNode); }
@Test public void testThatAppendDatasetWithFileAccessOnlyIsResolvedToNodeWithFileAccess() throws URISyntaxException { // preparation final String serviceName = "FILE"; final InvDatasetImpl dapDataset = createDataset(new String[]{serviceName}); // execution new CatalogTree(null, new DefaultAppContext(""), null).appendLeafNode(parentNode, getDefaultTreeModel(), dapDataset); // verification testThatChildIsNodeWithFileAccess(parentNode); }