use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.
the class DelegatesPrivateDatabasesTest method saveAndLoad_SetIsEmpty.
@Test
public void saveAndLoad_SetIsEmpty() throws Exception {
meta.setPrivateDatabases(Collections.<String>emptySet());
AbstractMeta restored = (AbstractMeta) delegate.dataNodeToElement(delegate.elementToDataNode(meta));
assertNotNull(restored.getPrivateDatabases());
assertTrue(restored.getPrivateDatabases().isEmpty());
}
use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.
the class DelegatesPrivateDatabasesTest method saveAndLoad_SetIsNull.
@Test
public void saveAndLoad_SetIsNull() throws Exception {
meta.setPrivateDatabases(null);
AbstractMeta restored = (AbstractMeta) delegate.dataNodeToElement(delegate.elementToDataNode(meta));
assertNull(restored.getPrivateDatabases());
}
use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.
the class SpoonRefreshDbConnectionsSubtreeTest method noConnectionsExist.
@Test
public void noConnectionsExist() {
AbstractMeta meta = mock(AbstractMeta.class);
when(meta.getDatabases()).thenReturn(Collections.<DatabaseMeta>emptyList());
callRefreshWith(meta, null);
// one call - to create a parent tree node
verifyNumberOfNodesCreated(0);
}
use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.
the class SpoonRefreshDbConnectionsSubtreeTest method severalConnectionsExist.
@Test
public void severalConnectionsExist() {
AbstractMeta meta = prepareMetaWithThreeDbs();
callRefreshWith(meta, null);
verifyNumberOfNodesCreated(3);
}
use of org.pentaho.di.base.AbstractMeta in project pentaho-kettle by pentaho.
the class SpoonRefreshDbConnectionsSubtreeTest method prepareMetaWithThreeDbs.
private static AbstractMeta prepareMetaWithThreeDbs() {
AbstractMeta meta = mock(AbstractMeta.class);
List<DatabaseMeta> dbs = asList(mockDatabaseMeta("1"), mockDatabaseMeta("2"), mockDatabaseMeta("3"));
when(meta.getDatabases()).thenReturn(dbs);
return meta;
}
Aggregations