use of org.talend.dq.nodes.DQDBFolderRepositoryNode in project tdq-studio-se by Talend.
the class RepNodeUtilsTest method testIsValidSelectionForMatchAnalysis.
/**
* Test: 1) when the selected node is: connection, catalog,schema, folder, will not be valid; 2) when the selected
* nodes are: multiple table/views, multiple columns from different table/view, will not be valid; 3) when the
* selected node is: one single table/view/file table,will be valid; 4) when the selected nodes are: multiple
* columns from one same table/view, will be valid.
*/
@Test
public void testIsValidSelectionForMatchAnalysis() {
// 1) when the selected node is: connection, catalog,schema, folder, will not be valid;
List<IRepositoryNode> nodes = new ArrayList<IRepositoryNode>();
ConnectionRepNode cNode = mock(ConnectionRepNode.class);
nodes.add(cNode);
Assert.assertFalse(RepNodeUtils.isValidSelectionFromSameTable(nodes));
DBConnectionRepNode dbNode = mock(DBConnectionRepNode.class);
nodes.clear();
nodes.add(dbNode);
Assert.assertFalse(RepNodeUtils.isValidSelectionFromSameTable(nodes));
DBConnectionFolderRepNode dbfNode = mock(DBConnectionFolderRepNode.class);
nodes.clear();
nodes.add(dbfNode);
Assert.assertFalse(RepNodeUtils.isValidSelectionFromSameTable(nodes));
DQDBFolderRepositoryNode folderNode = mock(DQDBFolderRepositoryNode.class);
nodes.clear();
nodes.add(folderNode);
Assert.assertFalse(RepNodeUtils.isValidSelectionFromSameTable(nodes));
DBCatalogRepNode catalogNode = mock(DBCatalogRepNode.class);
nodes.clear();
nodes.add(catalogNode);
Assert.assertFalse(RepNodeUtils.isValidSelectionFromSameTable(nodes));
DBSchemaRepNode schemaNode = mock(DBSchemaRepNode.class);
nodes.clear();
nodes.add(schemaNode);
Assert.assertFalse(RepNodeUtils.isValidSelectionFromSameTable(nodes));
}
use of org.talend.dq.nodes.DQDBFolderRepositoryNode in project tdq-studio-se by Talend.
the class CatalogSchemaComparisonLevel method reloadCurrentLevelElement.
@Override
public Connection reloadCurrentLevelElement() throws ReloadCompareException {
if (selectedObj instanceof DQDBFolderRepositoryNode) {
DQDBFolderRepositoryNode columnFolderRepNode = (DQDBFolderRepositoryNode) selectedObj;
columnFolderRepNode.setReload(true);
}
return super.reloadCurrentLevelElement();
}
use of org.talend.dq.nodes.DQDBFolderRepositoryNode in project tdq-studio-se by Talend.
the class TableViewComparisonLevel method reloadCurrentLevelElement.
@Override
public Connection reloadCurrentLevelElement() throws ReloadCompareException {
if (selectedObj instanceof DQDBFolderRepositoryNode) {
DQDBFolderRepositoryNode columnFolderRepNode = (DQDBFolderRepositoryNode) selectedObj;
columnFolderRepNode.setReload(true);
}
return super.reloadCurrentLevelElement();
}
use of org.talend.dq.nodes.DQDBFolderRepositoryNode in project tdq-studio-se by Talend.
the class ColumnsSelectionDialog method handleTreeExpanded.
/**
* Added TDQ-8718 20140506 yyin: when expand the nodes in the column select dialog, should refresh the table/view
* folder. otherwise: if the parent catalog is checked before expanding, it may get no children(without connecting
* to db) If the user has checked some high level node, must refresh the table/view folder node. otherwise, it
* always return 0
*/
@Override
protected void handleTreeExpanded(TreeItem item) {
Object node = item.getData();
if (node instanceof DBCatalogRepNode || node instanceof DBSchemaRepNode) {
TreeItem[] children = item.getItems();
if (children != null) {
for (TreeItem child : children) {
Object data = child.getData();
if (data != null) {
if (!(data instanceof DQDBFolderRepositoryNode)) {
break;
} else {
getTreeViewer().refresh(data, true);
}
}
}
}
}
super.handleTreeExpanded(item);
}
Aggregations