Search in sources :

Example 81 with Job

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

the class ScriptValueAddFunctions_SetVariableScopeTest method createJob.

private Job createJob() {
    Job job = new Job();
    job = spy(job);
    return job;
}
Also used : Job(org.pentaho.di.job.Job)

Example 82 with Job

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

the class ScriptValueAddFunctions_SetVariableScopeTest method setGrandParentScopeVariable_FourLevelHierarchy.

@Test
public void setGrandParentScopeVariable_FourLevelHierarchy() {
    Job grandGrandParent = createJob();
    Trans grandParent = createTrans(grandGrandParent);
    Trans parent = createTrans(grandParent);
    Trans child = createTrans(parent);
    ScriptValuesAddedFunctions.setGrandParentScopeVariable(child, VARIABLE_NAME, VARIABLE_VALUE);
    verify(child).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
    verify(parent).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
    verify(grandParent).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
    verify(grandGrandParent, never()).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
}
Also used : Job(org.pentaho.di.job.Job) Trans(org.pentaho.di.trans.Trans) Test(org.junit.Test)

Example 83 with Job

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

the class ScriptValueAddFunctions_SetVariableScopeTest method setRootScopeVariable_FourLevelHierarchy.

@Test
public void setRootScopeVariable_FourLevelHierarchy() {
    Job grandGrandParent = createJob();
    Trans grandParent = createTrans(grandGrandParent);
    Trans parent = createTrans(grandParent);
    Trans child = createTrans(parent);
    ScriptValuesAddedFunctions.setRootScopeVariable(child, VARIABLE_NAME, VARIABLE_VALUE);
    verify(child).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
    verify(parent).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
    verify(grandParent).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
    verify(grandGrandParent).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
}
Also used : Job(org.pentaho.di.job.Job) Trans(org.pentaho.di.trans.Trans) Test(org.junit.Test)

Example 84 with Job

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

the class JobEntryFTPPUTIT method executeStep.

private Result executeStep(JobEntryFTPPUT entry) throws Exception {
    Job job = new Job(null, new JobMeta());
    job.setStopped(false);
    entry.setParentJob(job);
    return entry.execute(new Result(), 0);
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) Job(org.pentaho.di.job.Job) Result(org.pentaho.di.core.Result)

Example 85 with Job

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

the class JobEntryFTPSGetIT method setMockParent.

private static void setMockParent(JobEntryBase job) {
    Job parent = mock(Job.class);
    when(parent.isStopped()).thenReturn(false);
    job.setParentJob(parent);
    job.setLogLevel(LogLevel.NOTHING);
}
Also used : Job(org.pentaho.di.job.Job)

Aggregations

Job (org.pentaho.di.job.Job)95 JobMeta (org.pentaho.di.job.JobMeta)44 Test (org.junit.Test)35 Result (org.pentaho.di.core.Result)22 KettleException (org.pentaho.di.core.exception.KettleException)20 PrintWriter (java.io.PrintWriter)17 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)17 Trans (org.pentaho.di.trans.Trans)14 IOException (java.io.IOException)11 Before (org.junit.Before)11 Point (org.pentaho.di.core.gui.Point)11 LogChannelInterface (org.pentaho.di.core.logging.LogChannelInterface)11 JobExecutionConfiguration (org.pentaho.di.job.JobExecutionConfiguration)10 Repository (org.pentaho.di.repository.Repository)10 ArrayList (java.util.ArrayList)9 ServletException (javax.servlet.ServletException)9 HttpServletRequest (javax.servlet.http.HttpServletRequest)9 HttpServletResponse (javax.servlet.http.HttpServletResponse)9 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)9 JobConfiguration (org.pentaho.di.job.JobConfiguration)9