use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.
the class MemoryRepository method saveDatabaseMetaStepAttribute.
@Override
public void saveDatabaseMetaStepAttribute(ObjectId id_transformation, ObjectId id_step, String code, DatabaseMeta database) throws KettleException {
ObjectId id = null;
if (database != null) {
id = database.getObjectId();
Long id_database = id == null ? Long.valueOf(-1L) : new LongObjectId(id).longValue();
saveStepAttribute(id_transformation, id_step, code, id_database);
}
}
use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.
the class DatabaseMetaLoadSaveValidator method getTestObject.
@Override
public DatabaseMeta getTestObject() {
DatabaseMeta db = new DatabaseMeta();
db.setObjectId(new LongObjectId(rand.nextInt(Integer.MAX_VALUE)));
db.setName(UUID.randomUUID().toString());
db.setHostname(UUID.randomUUID().toString());
db.setUsername(UUID.randomUUID().toString());
db.setPassword(UUID.randomUUID().toString());
return db;
}
use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryTest method testInsertTransStepCondition.
@Test
public void testInsertTransStepCondition() throws KettleException {
ArgumentCaptor<String> argumentTableName = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<RowMetaAndData> argumentTableData = ArgumentCaptor.forClass(RowMetaAndData.class);
doNothing().when(repo.connectionDelegate).insertTableRow(argumentTableName.capture(), argumentTableData.capture());
repo.insertTransStepCondition(new LongObjectId(234), new LongObjectId(567), new LongObjectId(468));
RowMetaAndData insertRecord = argumentTableData.getValue();
assertEquals(KettleDatabaseRepository.TABLE_R_TRANS_STEP_CONDITION, argumentTableName.getValue());
assertEquals(3, insertRecord.size());
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(0).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_STEP_CONDITION_ID_TRANSFORMATION, insertRecord.getValueMeta(0).getName());
assertEquals(Long.valueOf(234), insertRecord.getInteger(0));
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(1).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_STEP_CONDITION_ID_STEP, insertRecord.getValueMeta(1).getName());
assertEquals(Long.valueOf(567), insertRecord.getInteger(1));
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(2).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_STEP_CONDITION_ID_CONDITION, insertRecord.getValueMeta(2).getName());
assertEquals(Long.valueOf(468), insertRecord.getInteger(2));
}
use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryTest method testInsertTransformationCluster.
@Test
public void testInsertTransformationCluster() throws KettleException {
ArgumentCaptor<String> argumentTableName = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<RowMetaAndData> argumentTableData = ArgumentCaptor.forClass(RowMetaAndData.class);
doNothing().when(repo.connectionDelegate).insertTableRow(argumentTableName.capture(), argumentTableData.capture());
doReturn(new LongObjectId(123)).when(repo.connectionDelegate).getNextTransformationClusterID();
ObjectId result = repo.insertTransformationCluster(new LongObjectId(456), new LongObjectId(789));
RowMetaAndData insertRecord = argumentTableData.getValue();
assertEquals(KettleDatabaseRepository.TABLE_R_TRANS_CLUSTER, argumentTableName.getValue());
assertEquals(3, insertRecord.size());
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(0).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_CLUSTER_ID_TRANS_CLUSTER, insertRecord.getValueMeta(0).getName());
assertEquals(Long.valueOf(123), insertRecord.getInteger(0));
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(1).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_CLUSTER_ID_TRANSFORMATION, insertRecord.getValueMeta(1).getName());
assertEquals(Long.valueOf(456), insertRecord.getInteger(1));
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(2).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_CLUSTER_ID_CLUSTER, insertRecord.getValueMeta(2).getName());
assertEquals(Long.valueOf(789), insertRecord.getInteger(2));
assertEquals(new LongObjectId(123), result);
}
use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.
the class KettleDatabaseRepositoryTest method testInsertTransNote.
@Test
public void testInsertTransNote() throws KettleException {
ArgumentCaptor<String> argumentTableName = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<RowMetaAndData> argumentTableData = ArgumentCaptor.forClass(RowMetaAndData.class);
doNothing().when(repo.connectionDelegate).insertTableRow(argumentTableName.capture(), argumentTableData.capture());
repo.insertTransNote(new LongObjectId(456), new LongObjectId(789));
RowMetaAndData insertRecord = argumentTableData.getValue();
assertEquals(KettleDatabaseRepository.TABLE_R_TRANS_NOTE, argumentTableName.getValue());
assertEquals(2, insertRecord.size());
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(0).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_NOTE_ID_TRANSFORMATION, insertRecord.getValueMeta(0).getName());
assertEquals(Long.valueOf(456), insertRecord.getInteger(0));
assertEquals(ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta(1).getType());
assertEquals(KettleDatabaseRepository.FIELD_TRANS_NOTE_ID_NOTE, insertRecord.getValueMeta(1).getName());
assertEquals(Long.valueOf(789), insertRecord.getInteger(1));
}
Aggregations