Search in sources :

Example 16 with JobGraph

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

Example 17 with JobGraph

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);
}
Also used : TabItem(org.pentaho.xul.swt.tab.TabItem) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) Test(org.junit.Test)

Example 18 with JobGraph

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);
}
Also used : JobExecutionConfigurationDialog(org.pentaho.di.ui.job.dialog.JobExecutionConfigurationDialog) Shell(org.eclipse.swt.widgets.Shell) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) JobExecutionConfiguration(org.pentaho.di.job.JobExecutionConfiguration) JobLogDelegate(org.pentaho.di.ui.spoon.job.JobLogDelegate) Test(org.junit.Test)

Example 19 with JobGraph

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();
    }
}
Also used : TransAction(org.pentaho.di.core.undo.TransAction) JobMeta(org.pentaho.di.job.JobMeta) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransMeta(org.pentaho.di.trans.TransMeta) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Example 20 with JobGraph

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();
        }
    }
}
Also used : JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Aggregations

JobGraph (org.pentaho.di.ui.spoon.job.JobGraph)27 TransGraph (org.pentaho.di.ui.spoon.trans.TransGraph)15 JobMeta (org.pentaho.di.job.JobMeta)8 TransMeta (org.pentaho.di.trans.TransMeta)6 Test (org.junit.Test)5 TabMapEntry (org.pentaho.di.ui.spoon.TabMapEntry)5 TabItem (org.pentaho.xul.swt.tab.TabItem)5 EngineMetaInterface (org.pentaho.di.core.EngineMetaInterface)4 KettleException (org.pentaho.di.core.exception.KettleException)4 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)4 FileObject (org.apache.commons.vfs2.FileObject)3 Point (org.pentaho.di.core.gui.Point)3 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)3 AbstractMeta (org.pentaho.di.base.AbstractMeta)2 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)2 TransAction (org.pentaho.di.core.undo.TransAction)2 JobExecutionConfiguration (org.pentaho.di.job.JobExecutionConfiguration)2 PurRepository (org.pentaho.di.repository.pur.PurRepository)2 IAbsSecurityProvider (org.pentaho.di.ui.repository.pur.services.IAbsSecurityProvider)2 Spoon (org.pentaho.di.ui.spoon.Spoon)2