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