use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class SpoonActiveJobGraphTest method returnNullActiveJobGraphIfJobTabNotExists.
@Test
public void returnNullActiveJobGraphIfJobTabNotExists() {
JobGraph actualJobGraph = spoon.getActiveJobGraph();
assertNull(actualJobGraph);
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class SpoonActiveJobGraphTest method returnActiveJobGraphIfJobTabExists.
@Test
public void returnActiveJobGraphIfJobTabExists() {
TabMapEntry tabMapEntry = mock(TabMapEntry.class);
JobGraph jobGraph = mock(JobGraph.class);
Mockito.when(tabMapEntry.getObject()).thenReturn(jobGraph);
Mockito.when(spoon.delegates.tabs.getTab(Mockito.any(TabItem.class))).thenReturn(tabMapEntry);
JobGraph actualJobGraph = spoon.getActiveJobGraph();
assertNotNull(actualJobGraph);
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class SpoonJobDelegateTest method testSetParamsIntoMetaInExecuteJob.
@Test
@SuppressWarnings("ResultOfMethodCallIgnored")
public void testSetParamsIntoMetaInExecuteJob() throws KettleException {
doCallRealMethod().when(delegate).executeJob(jobMeta, true, false, null, false, null, 0);
JobExecutionConfiguration jobExecutionConfiguration = mock(JobExecutionConfiguration.class);
RowMetaInterface rowMeta = mock(RowMetaInterface.class);
Shell shell = mock(Shell.class);
JobExecutionConfigurationDialog jobExecutionConfigurationDialog = mock(JobExecutionConfigurationDialog.class);
JobGraph activeJobGraph = mock(JobGraph.class);
activeJobGraph.jobLogDelegate = mock(JobLogDelegate.class);
doReturn(jobExecutionConfiguration).when(spoon).getJobExecutionConfiguration();
doReturn(rowMeta).when(spoon.variables).getRowMeta();
doReturn(EMPTY_STRING_ARRAY).when(rowMeta).getFieldNames();
doReturn(shell).when(spoon).getShell();
doReturn(jobExecutionConfigurationDialog).when(delegate).newJobExecutionConfigurationDialog(jobExecutionConfiguration, jobMeta);
doReturn(activeJobGraph).when(spoon).getActiveJobGraph();
doReturn(MAP_WITH_TEST_VARIABLE).when(jobExecutionConfiguration).getVariables();
doReturn(MAP_WITH_TEST_PARAM).when(jobExecutionConfiguration).getParams();
doReturn(TEST_LOG_LEVEL).when(jobExecutionConfiguration).getLogLevel();
doReturn(TEST_START_COPY_NAME).when(jobExecutionConfiguration).getStartCopyName();
doReturn(TEST_BOOLEAN_PARAM).when(jobExecutionConfiguration).isClearingLog();
doReturn(TEST_BOOLEAN_PARAM).when(jobExecutionConfiguration).isSafeModeEnabled();
doReturn(TEST_BOOLEAN_PARAM).when(jobExecutionConfiguration).isExpandingRemoteJob();
delegate.executeJob(jobMeta, true, false, null, false, null, 0);
verify(jobMeta).setVariable(TEST_VARIABLE_KEY, TEST_VARIABLE_VALUE);
verify(jobMeta).setParameterValue(TEST_PARAM_KEY, TEST_PARAM_VALUE);
verify(jobMeta).activateParameters();
verify(jobMeta).setLogLevel(TEST_LOG_LEVEL);
verify(jobMeta).setStartCopyName(TEST_START_COPY_NAME);
verify(jobMeta).setClearingLog(TEST_BOOLEAN_PARAM);
verify(jobMeta).setSafeModeEnabled(TEST_BOOLEAN_PARAM);
verify(jobMeta).setExpandingRemoteJob(TEST_BOOLEAN_PARAM);
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class Spoon method redoAction.
public void redoAction(UndoInterface undoInterface) {
if (undoInterface == null) {
return;
}
TransAction ta = undoInterface.nextUndo();
if (ta == null) {
return;
}
// something changed: change the menu
setUndoMenu(undoInterface);
if (undoInterface instanceof TransMeta) {
delegates.trans.redoTransformationAction((TransMeta) undoInterface, ta);
if (ta.getType() == TransAction.TYPE_ACTION_DELETE_HOP) {
// something changed: change the menu
setUndoMenu(undoInterface);
ta = undoInterface.viewNextUndo();
if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_STEP) {
ta = undoInterface.nextUndo();
delegates.trans.redoTransformationAction((TransMeta) undoInterface, ta);
}
}
}
if (undoInterface instanceof JobMeta) {
delegates.jobs.redoJobAction((JobMeta) undoInterface, ta);
if (ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_HOP) {
// something changed: change the menu
setUndoMenu(undoInterface);
ta = undoInterface.viewNextUndo();
if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_ENTRY) {
ta = undoInterface.nextUndo();
delegates.jobs.redoJobAction((JobMeta) undoInterface, ta);
}
}
}
// Put what we redo in focus
if (undoInterface instanceof TransMeta) {
TransGraph transGraph = delegates.trans.findTransGraphOfTransformation((TransMeta) undoInterface);
transGraph.forceFocus();
}
if (undoInterface instanceof JobMeta) {
JobGraph jobGraph = delegates.jobs.findJobGraphOfJob((JobMeta) undoInterface);
jobGraph.forceFocus();
}
}
use of org.pentaho.di.ui.spoon.job.JobGraph in project pentaho-kettle by pentaho.
the class Spoon method showExecutionResults.
public void showExecutionResults() {
TransGraph transGraph = getActiveTransGraph();
if (transGraph != null) {
transGraph.showExecutionResults();
enableMenus();
} else {
JobGraph jobGraph = getActiveJobGraph();
if (jobGraph != null) {
jobGraph.showExecutionResults();
enableMenus();
}
}
}
Aggregations