Search in sources :

Example 1 with SpoonDBDelegate

use of org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate in project pentaho-kettle by pentaho.

the class SharedObjectSyncUtilTest method setUp.

@Before
public void setUp() {
    spoon = mock(Spoon.class);
    // when( spoon.getRepository() ).thenReturn( spoon.rep );
    spoonDelegates = mock(SpoonDelegates.class);
    spoonDelegates.jobs = new SpoonJobDelegate(spoon);
    spoonDelegates.trans = new SpoonTransformationDelegate(spoon);
    spoonDelegates.db = new SpoonDBDelegate(spoon);
    spoonDelegates.slaves = new SpoonSlaveDelegate(spoon);
    spoonDelegates.partitions = new SpoonPartitionsDelegate(spoon);
    spoonDelegates.clusters = new SpoonClustersDelegate(spoon);
    spoon.delegates = spoonDelegates;
    sharedUtil = new SharedObjectSyncUtil(spoon);
    repository = mock(Repository.class);
}
Also used : SpoonSlaveDelegate(org.pentaho.di.ui.spoon.delegates.SpoonSlaveDelegate) SpoonTransformationDelegate(org.pentaho.di.ui.spoon.delegates.SpoonTransformationDelegate) Repository(org.pentaho.di.repository.Repository) SpoonPartitionsDelegate(org.pentaho.di.ui.spoon.delegates.SpoonPartitionsDelegate) SpoonClustersDelegate(org.pentaho.di.ui.spoon.delegates.SpoonClustersDelegate) SpoonDBDelegate(org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate) SpoonDelegates(org.pentaho.di.ui.spoon.delegates.SpoonDelegates) SpoonJobDelegate(org.pentaho.di.ui.spoon.delegates.SpoonJobDelegate) Before(org.junit.Before)

Example 2 with SpoonDBDelegate

use of org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate in project pentaho-kettle by pentaho.

the class EnterSelectionDialog method addDataSource.

protected void addDataSource() {
    Spoon theSpoon = Spoon.getInstance();
    SpoonDBDelegate theDelegate = new SpoonDBDelegate(theSpoon);
    theDelegate.newConnection(this.databasesInterface);
    ArrayList<DatabaseMeta> theDatabases = new ArrayList<DatabaseMeta>();
    theDatabases.addAll(this.databasesInterface.getDatabases());
    String[] theNames = new String[theDatabases.size()];
    for (int i = 0; i < theDatabases.size(); i++) {
        theNames[i] = theDatabases.get(i).getName();
    }
    this.choices = theNames;
    refresh();
}
Also used : Spoon(org.pentaho.di.ui.spoon.Spoon) ArrayList(java.util.ArrayList) SpoonDBDelegate(org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta)

Aggregations

SpoonDBDelegate (org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)1 Repository (org.pentaho.di.repository.Repository)1 Spoon (org.pentaho.di.ui.spoon.Spoon)1 SpoonClustersDelegate (org.pentaho.di.ui.spoon.delegates.SpoonClustersDelegate)1 SpoonDelegates (org.pentaho.di.ui.spoon.delegates.SpoonDelegates)1 SpoonJobDelegate (org.pentaho.di.ui.spoon.delegates.SpoonJobDelegate)1 SpoonPartitionsDelegate (org.pentaho.di.ui.spoon.delegates.SpoonPartitionsDelegate)1 SpoonSlaveDelegate (org.pentaho.di.ui.spoon.delegates.SpoonSlaveDelegate)1 SpoonTransformationDelegate (org.pentaho.di.ui.spoon.delegates.SpoonTransformationDelegate)1