Search in sources :

Example 1 with CatalogSchemaComparisonLevel

use of org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel in project tdq-studio-se by Talend.

the class TestComparisonLevelFactoryTest method testCreatComparisonLevelObject_2.

/**
 * Test method for
 * {@link org.talend.cwm.compare.factory.ComparisonLevelFactory#creatComparisonLevel(java.lang.Object)}. test for
 * the type of : table folder rep node
 */
@Test
public void testCreatComparisonLevelObject_2() {
    RepositoryNode dbCatalogRepNode = createCatalogRepNode();
    DBTableFolderRepNode dbTableFolderRepNode = new DBTableFolderRepNode(null, dbCatalogRepNode, null, null);
    IComparisonLevel level = ComparisonLevelFactory.creatComparisonLevel(dbTableFolderRepNode);
    Assert.assertTrue(level instanceof CatalogSchemaComparisonLevel);
}
Also used : DBTableFolderRepNode(org.talend.dq.nodes.DBTableFolderRepNode) RepositoryNode(org.talend.repository.model.RepositoryNode) CatalogSchemaComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel) Test(org.junit.Test)

Example 2 with CatalogSchemaComparisonLevel

use of org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel in project tdq-studio-se by Talend.

the class TestComparisonLevelFactoryTest method testCreatComparisonLevelObject_3.

/**
 * Test method for
 * {@link org.talend.cwm.compare.factory.ComparisonLevelFactory#creatComparisonLevel(java.lang.Object)}. test for
 * the type of : db view rep node
 */
@Test
public void testCreatComparisonLevelObject_3() {
    // 
    RepositoryNode dbCatalogRepNode = createCatalogRepNode();
    DBViewFolderRepNode node = new DBViewFolderRepNode(null, dbCatalogRepNode, null, null);
    IComparisonLevel level = ComparisonLevelFactory.creatComparisonLevel(node);
    Assert.assertTrue(level instanceof CatalogSchemaComparisonLevel);
}
Also used : RepositoryNode(org.talend.repository.model.RepositoryNode) CatalogSchemaComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel) DBViewFolderRepNode(org.talend.dq.nodes.DBViewFolderRepNode) Test(org.junit.Test)

Example 3 with CatalogSchemaComparisonLevel

use of org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel in project tdq-studio-se by Talend.

the class ComparisonLevelFactory method creatComparisonLevel.

public static IComparisonLevel creatComparisonLevel(Object selectedObject) {
    IComparisonLevel comparisonLevel = null;
    if (selectedObject instanceof DBConnectionRepNode) {
        // MOD klliu 2011-02-24 bug 19015
        IRepositoryViewObject resObject = ((DBConnectionRepNode) selectedObject).getObject();
        comparisonLevel = new RepositoryObjectComparisonLevel(resObject);
    } else if (selectedObject instanceof DBTableFolderRepNode) {
        // MOD mzhao FolderNode param need to pass for later reloading from this folder.
        DBTableFolderRepNode dbFolderNode = (DBTableFolderRepNode) selectedObject;
        comparisonLevel = new CatalogSchemaComparisonLevel(dbFolderNode);
    } else if (selectedObject instanceof DBViewFolderRepNode) {
        // MOC yyin 20121101, TDQ-6092, add a condition for the db which donot have catalog, like oracle.
        if ((null == ((DBViewFolderRepNode) selectedObject).getCatalog()) && (((DBViewFolderRepNode) selectedObject).getParent() instanceof DBConnectionFolderRepNode)) {
            // MOD yyi 2011-07-14 21512:the selected obj is db connection in this case
            IRepositoryViewObject resObject = ((DBViewFolderRepNode) selectedObject).getParent().getObject();
            comparisonLevel = new RepositoryObjectComparisonLevel(resObject);
        } else {
            DBViewFolderRepNode dbFolderNode = (DBViewFolderRepNode) selectedObject;
            comparisonLevel = new CatalogSchemaComparisonLevel(dbFolderNode);
        }
    } else if (selectedObject instanceof DBColumnFolderRepNode) {
        DBColumnFolderRepNode dbFolderNode = (DBColumnFolderRepNode) selectedObject;
        comparisonLevel = new TableViewComparisonLevel(dbFolderNode);
    } else if (selectedObject instanceof MetadataTable) {
        MetadataTable resObject = (MetadataTable) selectedObject;
        comparisonLevel = new FileMetadataTableComparisonLevel(resObject);
    } else if (selectedObject instanceof Connection) {
        // MOD qiongli 2011-9-5 feature TDQ-3317.
        comparisonLevel = new DataProviderComparisonLevel(selectedObject);
    } else {
        comparisonLevel = null;
    }
    return comparisonLevel;
}
Also used : DBTableFolderRepNode(org.talend.dq.nodes.DBTableFolderRepNode) DataProviderComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.DataProviderComparisonLevel) DBConnectionRepNode(org.talend.dq.nodes.DBConnectionRepNode) RepositoryObjectComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.RepositoryObjectComparisonLevel) Connection(org.talend.core.model.metadata.builder.connection.Connection) CatalogSchemaComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel) DBViewFolderRepNode(org.talend.dq.nodes.DBViewFolderRepNode) DBColumnFolderRepNode(org.talend.dq.nodes.DBColumnFolderRepNode) TableViewComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.TableViewComparisonLevel) FileMetadataTableComparisonLevel(org.talend.cwm.compare.factory.comparisonlevel.FileMetadataTableComparisonLevel) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) DBConnectionFolderRepNode(org.talend.dq.nodes.DBConnectionFolderRepNode)

Aggregations

CatalogSchemaComparisonLevel (org.talend.cwm.compare.factory.comparisonlevel.CatalogSchemaComparisonLevel)3 Test (org.junit.Test)2 DBTableFolderRepNode (org.talend.dq.nodes.DBTableFolderRepNode)2 DBViewFolderRepNode (org.talend.dq.nodes.DBViewFolderRepNode)2 RepositoryNode (org.talend.repository.model.RepositoryNode)2 Connection (org.talend.core.model.metadata.builder.connection.Connection)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 DataProviderComparisonLevel (org.talend.cwm.compare.factory.comparisonlevel.DataProviderComparisonLevel)1 FileMetadataTableComparisonLevel (org.talend.cwm.compare.factory.comparisonlevel.FileMetadataTableComparisonLevel)1 RepositoryObjectComparisonLevel (org.talend.cwm.compare.factory.comparisonlevel.RepositoryObjectComparisonLevel)1 TableViewComparisonLevel (org.talend.cwm.compare.factory.comparisonlevel.TableViewComparisonLevel)1 DBColumnFolderRepNode (org.talend.dq.nodes.DBColumnFolderRepNode)1 DBConnectionFolderRepNode (org.talend.dq.nodes.DBConnectionFolderRepNode)1 DBConnectionRepNode (org.talend.dq.nodes.DBConnectionRepNode)1