Search in sources :

Example 41 with AbstractMeta

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());
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 42 with AbstractMeta

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());
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 43 with AbstractMeta

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);
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 44 with AbstractMeta

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);
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) Test(org.junit.Test)

Example 45 with AbstractMeta

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;
}
Also used : AbstractMeta(org.pentaho.di.base.AbstractMeta) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta)

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