Search in sources :

Example 91 with DatabaseMeta

use of org.pentaho.di.core.database.DatabaseMeta in project pentaho-kettle by pentaho.

the class KettleFileRepository_DatabaseNames_Test method getDatabaseId_InsensitiveMatch.

@Test
public void getDatabaseId_InsensitiveMatch() throws Exception {
    final String name = "databaseWithCamelCase";
    final String lookupName = name.toLowerCase();
    assertNotSame(lookupName, name);
    DatabaseMeta db = saveDatabase(name);
    ObjectId id = repository.getDatabaseID(lookupName);
    assertEquals(db.getObjectId(), id);
}
Also used : ObjectId(org.pentaho.di.repository.ObjectId) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Test(org.junit.Test)

Example 92 with DatabaseMeta

use of org.pentaho.di.core.database.DatabaseMeta in project pentaho-kettle by pentaho.

the class KettleFileRepository_DatabaseNames_Test method getDatabaseId_ExactMatch.

@Test
public void getDatabaseId_ExactMatch() throws Exception {
    final String name = UUID.randomUUID().toString();
    DatabaseMeta db = saveDatabase(name);
    ObjectId id = repository.getDatabaseID(name);
    assertEquals(db.getObjectId(), id);
}
Also used : ObjectId(org.pentaho.di.repository.ObjectId) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Test(org.junit.Test)

Example 93 with DatabaseMeta

use of org.pentaho.di.core.database.DatabaseMeta in project pentaho-kettle by pentaho.

the class KettleFileRepository_DatabaseNames_Test method saveDatabase.

private DatabaseMeta saveDatabase(String name) throws Exception {
    DatabaseMeta db = new DatabaseMeta();
    db.setName(name);
    repository.save(db, null, null);
    assertNotNull(db.getObjectId());
    return db;
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta)

Example 94 with DatabaseMeta

use of org.pentaho.di.core.database.DatabaseMeta in project pentaho-kettle by pentaho.

the class KettleDatabaseRepositoryTest method setUp.

@Before
public void setUp() {
    repo = spy(new KettleDatabaseRepository());
    repo.setRepositoryMeta(new KettleDatabaseRepositoryMeta("myId", "myName", "myDescription", new DatabaseMeta()));
    repo.connectionDelegate = spy(new KettleDatabaseRepositoryConnectionDelegate(repo, new DatabaseMeta()));
}
Also used : KettleDatabaseRepositoryConnectionDelegate(org.pentaho.di.repository.kdr.delegates.KettleDatabaseRepositoryConnectionDelegate) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Before(org.junit.Before)

Example 95 with DatabaseMeta

use of org.pentaho.di.core.database.DatabaseMeta in project pentaho-kettle by pentaho.

the class KettleDatabaseRepositoryCreationHelperTest method testOracleDBRepoStringLength.

@Test
public void testOracleDBRepoStringLength() throws Exception {
    KettleEnvironment.init();
    DatabaseMeta databaseMeta = new DatabaseMeta("OraRepo", "ORACLE", "JDBC", null, "test", null, null, null);
    repositoryMeta = new KettleDatabaseRepositoryMeta("KettleDatabaseRepository", "OraRepo", "Ora Repository", databaseMeta);
    repository = new KettleDatabaseRepository();
    repository.init(repositoryMeta);
    KettleDatabaseRepositoryCreationHelper helper = new KettleDatabaseRepositoryCreationHelper(repository);
    int repoStringLength = helper.getRepoStringLength();
    assertEquals(EXPECTED_ORACLE_DB_REPO_STRING, repoStringLength);
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) OracleDatabaseMeta(org.pentaho.di.core.database.OracleDatabaseMeta) Test(org.junit.Test)

Aggregations

DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)522 Test (org.junit.Test)133 KettleException (org.pentaho.di.core.exception.KettleException)131 Database (org.pentaho.di.core.database.Database)88 MessageBox (org.eclipse.swt.widgets.MessageBox)66 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)63 TransMeta (org.pentaho.di.trans.TransMeta)57 StepMeta (org.pentaho.di.trans.step.StepMeta)54 ArrayList (java.util.ArrayList)53 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)48 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)44 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)42 SlaveServer (org.pentaho.di.cluster.SlaveServer)33 IMetaStore (org.pentaho.metastore.api.IMetaStore)30 ObjectId (org.pentaho.di.repository.ObjectId)29 DatabaseExplorerDialog (org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog)29 JobMeta (org.pentaho.di.job.JobMeta)26 TransHopMeta (org.pentaho.di.trans.TransHopMeta)26 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)24 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)24