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);
}
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;
}
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"));
}
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);
}
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);
}
Aggregations