Search in sources :

Example 11 with AbstractMeta

use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.

the class SpoonRefreshSlavesSubtreeTest method noConnectionsExist.

@Test
public void noConnectionsExist() {
    AbstractMeta meta = mock(AbstractMeta.class);
    when(meta.getSlaveServers()).thenReturn(Collections.<SlaveServer>emptyList());
    callRefreshWith(meta, null);
    verifyNumberOfNodesCreated(0);
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 12 with AbstractMeta

use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.

the class DatabasesCollectorTest method prepareMeta.

private static AbstractMeta prepareMeta(DatabaseMeta... metas) {
    if (metas == null) {
        metas = new DatabaseMeta[0];
    }
    AbstractMeta meta = mock(AbstractMeta.class);
    List<DatabaseMeta> dbs = asList(metas);
    when(meta.getDatabases()).thenReturn(dbs);
    return meta;
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta)

Example 13 with AbstractMeta

use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.

the class DatabasesCollectorTest method repositoryDuplicates.

@Test
public void repositoryDuplicates() throws Exception {
    AbstractMeta meta = prepareMeta(mockDb("mysql"));
    Repository repository = mockRepository(mockDb("mysql"));
    DatabasesCollector collector = new DatabasesCollector(meta, repository);
    collector.collectDatabases();
    assertEquals(collector.getDatabaseNames().size(), 1);
    assertNotNull(collector.getMetaFor("mysql"));
}
Also used : Repository(org.pentaho.di.repository.Repository) AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 14 with AbstractMeta

use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.

the class DatabasesCollectorTest method repositoryContainsUnique.

@Test
public void repositoryContainsUnique() throws Exception {
    AbstractMeta meta = prepareMeta(mockDb("mysql"), mockDb("oracle"));
    Repository repository = mockRepository(mockDb("h2"));
    DatabasesCollector collector = new DatabasesCollector(meta, repository);
    collector.collectDatabases();
    assertEquals(collector.getDatabaseNames().size(), 3);
}
Also used : Repository(org.pentaho.di.repository.Repository) AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 15 with AbstractMeta

use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.

the class SpoonRefreshDbConnectionsSubtreeTest method onlyOneMatchesFiltering.

@Test
public void onlyOneMatchesFiltering() {
    AbstractMeta meta = prepareMetaWithThreeDbs();
    callRefreshWith(meta, "2");
    verifyNumberOfNodesCreated(1);
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Aggregations

AbstractMeta (org.pentaho.di.base.AbstractMeta)50 Test (org.junit.Test)18 KettleException (org.pentaho.di.core.exception.KettleException)10 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)7 LogChannelInterface (org.pentaho.di.core.logging.LogChannelInterface)6 JobMeta (org.pentaho.di.job.JobMeta)6 TransMeta (org.pentaho.di.trans.TransMeta)6 FileObject (org.apache.commons.vfs2.FileObject)5 ExtensionPointWrapper (org.pentaho.di.ui.core.events.dialog.extension.ExtensionPointWrapper)5 SlaveServer (org.pentaho.di.cluster.SlaveServer)4 EngineMetaInterface (org.pentaho.di.core.EngineMetaInterface)4 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)4 RunConfiguration (org.pentaho.di.engine.configuration.api.RunConfiguration)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 EmbeddedMetaStore (org.pentaho.di.core.attributes.metastore.EmbeddedMetaStore)3 ExtensionPoint (org.pentaho.di.core.extension.ExtensionPoint)3 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)3 EmbeddedRunConfigurationManager (org.pentaho.di.engine.configuration.impl.EmbeddedRunConfigurationManager)3 RunConfigurationManager (org.pentaho.di.engine.configuration.impl.RunConfigurationManager)3 RepositoryObject (org.pentaho.di.repository.RepositoryObject)3