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