use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class JobEntryDialog_ConnectionLine_Test method ignores_WhenConnectionNameIsUsed.
@Test
public void ignores_WhenConnectionNameIsUsed() throws Exception {
JobMeta jobMeta = new JobMeta();
jobMeta.addDatabase(createDefaultDatabase());
invokeAddConnectionListener(jobMeta, null);
assertOnlyDbExists(jobMeta, INITIAL_NAME, INITIAL_HOST);
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class JobEntryDialog_ConnectionLine_Test method test_showDbDialogUnlessCancelledOrValid_ShownOnce.
private void test_showDbDialogUnlessCancelledOrValid_ShownOnce(String inputName, String expectedResult) throws Exception {
DatabaseDialog databaseDialog = mock(DatabaseDialog.class);
when(databaseDialog.open()).thenReturn(inputName);
JobMeta jobMeta = new JobMeta();
DatabaseMeta db = createDefaultDatabase();
jobMeta.addDatabase(db);
JobEntryDialog dialog = mock(JobEntryDialog.class);
dialog.databaseDialog = databaseDialog;
dialog.jobMeta = jobMeta;
when(dialog.showDbDialogUnlessCancelledOrValid(anyDbMeta(), anyDbMeta())).thenCallRealMethod();
String result = dialog.showDbDialogUnlessCancelledOrValid((DatabaseMeta) db.clone(), db);
assertEquals(expectedResult, result);
// database dialog should be shown only once
verify(databaseDialog, times(1)).open();
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class JobEntryDialog_ConnectionLine_Test method edits_WhenNewNameIsUnique.
@Test
public void edits_WhenNewNameIsUnique() throws Exception {
JobMeta jobMeta = new JobMeta();
jobMeta.addDatabase(createDefaultDatabase());
invokeEditConnectionListener(jobMeta, INPUT_NAME);
assertOnlyDbExists(jobMeta, INPUT_NAME, INPUT_HOST);
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class JobEntryDialog_ConnectionLine_Test method adds_WhenConnectionNameIsUnique.
@Test
public void adds_WhenConnectionNameIsUnique() throws Exception {
JobMeta jobMeta = new JobMeta();
invokeAddConnectionListener(jobMeta, INPUT_NAME);
assertOnlyDbExists(jobMeta, INPUT_NAME, INPUT_HOST);
}
use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.
the class JobEntryDialog_ConnectionLine_Test method edits_WhenNotRenamed.
@Test
public void edits_WhenNotRenamed() throws Exception {
JobMeta jobMeta = new JobMeta();
jobMeta.addDatabase(createDefaultDatabase());
invokeEditConnectionListener(jobMeta, INITIAL_NAME);
assertOnlyDbExists(jobMeta, INITIAL_NAME, INPUT_HOST);
}
Aggregations