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