Search in sources :

Example 1 with JobMeta

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);
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Test(org.junit.Test)

Example 2 with JobMeta

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();
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) DatabaseDialog(org.pentaho.di.ui.core.database.dialog.DatabaseDialog)

Example 3 with JobMeta

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);
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Test(org.junit.Test)

Example 4 with JobMeta

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);
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Test(org.junit.Test)

Example 5 with JobMeta

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);
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Test(org.junit.Test)

Aggregations

JobMeta (org.pentaho.di.job.JobMeta)254 Test (org.junit.Test)88 TransMeta (org.pentaho.di.trans.TransMeta)69 KettleException (org.pentaho.di.core.exception.KettleException)62 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)48 Job (org.pentaho.di.job.Job)45 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)27 Repository (org.pentaho.di.repository.Repository)25 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)25 Point (org.pentaho.di.core.gui.Point)24 ArrayList (java.util.ArrayList)23 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)22 SlaveServer (org.pentaho.di.cluster.SlaveServer)17 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)17 FileObject (org.apache.commons.vfs2.FileObject)16 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)16 LogChannelInterface (org.pentaho.di.core.logging.LogChannelInterface)15 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)15 PrintWriter (java.io.PrintWriter)12 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)12