Search in sources :

Example 16 with JobMeta

use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.

the class SharedObjectSyncUtilTest method synchronizeSlaveServers_use_case_sensitive_name.

@Test
public void synchronizeSlaveServers_use_case_sensitive_name() throws Exception {
    JobMeta job1 = createJobMeta();
    SlaveServer slaveServer1 = createSlaveServer("SlaveServer", true);
    job1.setSlaveServers(Collections.singletonList(slaveServer1));
    spoonDelegates.jobs.addJob(job1);
    JobMeta job2 = createJobMeta();
    SlaveServer slaveServer2 = createSlaveServer("Slaveserver", true);
    job2.setSlaveServers(Collections.singletonList(slaveServer2));
    spoonDelegates.jobs.addJob(job2);
    slaveServer2.setHostname(AFTER_SYNC_VALUE);
    sharedUtil.synchronizeSlaveServers(slaveServer2);
    assertThat(slaveServer1.getHostname(), equalTo(BEFORE_SYNC_VALUE));
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) SlaveServer(org.pentaho.di.cluster.SlaveServer) Test(org.junit.Test)

Example 17 with JobMeta

use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.

the class SpoonExportXmlTest method savingJobToXmlNotChangesLogTables.

@Test
public void savingJobToXmlNotChangesLogTables() {
    JobMeta jobMeta = new JobMeta();
    initTables(jobMeta);
    JobLogTable originJobLogTable = jobMeta.getJobLogTable();
    JobEntryLogTable originJobEntryLogTable = jobMeta.getJobEntryLogTable();
    ChannelLogTable originChannelLogTable = jobMeta.getChannelLogTable();
    when(spoon.getActiveTransformation()).thenReturn(null);
    when(spoon.getActiveJob()).thenReturn(jobMeta);
    when(spoon.saveXMLFile(any(JobMeta.class), anyBoolean())).thenReturn(true);
    when(spoon.saveXMLFile(anyBoolean())).thenCallRealMethod();
    spoon.saveXMLFile(true);
    tablesCommonValuesEqual(originJobLogTable, jobMeta.getJobLogTable());
    assertEquals(originJobLogTable.getLogInterval(), jobMeta.getJobLogTable().getLogInterval());
    assertEquals(originJobLogTable.getLogSizeLimit(), jobMeta.getJobLogTable().getLogSizeLimit());
    tablesCommonValuesEqual(originJobEntryLogTable, jobMeta.getJobEntryLogTable());
    tablesCommonValuesEqual(originChannelLogTable, jobMeta.getChannelLogTable());
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) JobLogTable(org.pentaho.di.core.logging.JobLogTable) ChannelLogTable(org.pentaho.di.core.logging.ChannelLogTable) JobEntryLogTable(org.pentaho.di.core.logging.JobEntryLogTable) Test(org.junit.Test)

Example 18 with JobMeta

use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.

the class SpoonTest method testJobToRepSaveFileAsFailed.

@Test
public void testJobToRepSaveFileAsFailed() throws Exception {
    JobMeta mockJobMeta = mock(JobMeta.class);
    // passing a invalid type so not running GUIResource class
    prepareSetSaveTests(spoon, log, mockSpoonPerspective, mockJobMeta, false, false, MainSpoonPerspective.ID, false, true, "Invalid TYPE", null, true, true);
    doCallRealMethod().when(spoon).saveFileAs(mockJobMeta);
    assertFalse(spoon.saveFileAs(mockJobMeta));
    verify(mockJobMeta).setRepository(spoon.rep);
    verify(mockJobMeta).setMetaStore(spoon.metaStore);
    verify(mockJobMeta).setObjectId(null);
    verify(mockJobMeta).setFilename(null);
    verify(spoon).enableMenus();
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Test(org.junit.Test)

Example 19 with JobMeta

use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.

the class SpoonTest method testJobToXMLFileSaveFileAs.

@Test
public void testJobToXMLFileSaveFileAs() throws Exception {
    JobMeta mockJobMeta = mock(JobMeta.class);
    // passing a invalid type so not running GUIResource class
    prepareSetSaveTests(spoon, log, mockSpoonPerspective, mockJobMeta, true, true, "NotMainSpoonPerspective", true, true, "Invalid TYPE", null, true, true);
    doCallRealMethod().when(spoon).saveFileAs(mockJobMeta);
    assertTrue(spoon.saveFileAs(mockJobMeta));
    verify(mockJobMeta).setRepository(spoon.rep);
    verify(mockJobMeta).setMetaStore(spoon.metaStore);
    verify(spoon.delegates.tabs).findTabMapEntry(mockJobMeta);
    verify(spoon).enableMenus();
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Test(org.junit.Test)

Example 20 with JobMeta

use of org.pentaho.di.job.JobMeta in project pentaho-kettle by pentaho.

the class SpoonTest method testSetShellTextForJobWVersionDisabled.

@Test
public void testSetShellTextForJobWVersionDisabled() {
    JobMeta mockJobMeta = mock(JobMeta.class);
    Shell mockShell = prepareSetShellTextTests(spoon, mockJobMeta, false, false, false, false, false, false, false, false);
    verify(mockShell).setText("Spoon - [RepositoryName] jobName");
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Shell(org.eclipse.swt.widgets.Shell) 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