use of org.pentaho.di.trans.Trans in project pentaho-kettle by pentaho.
the class ScriptValueAddFunctions_SetVariableScopeTest method setGrandParentScopeVariable_NoParent.
@Test
public void setGrandParentScopeVariable_NoParent() {
Trans trans = createTrans();
ScriptValuesAddedFunctions.setGrandParentScopeVariable(trans, VARIABLE_NAME, VARIABLE_VALUE);
verify(trans).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
}
use of org.pentaho.di.trans.Trans in project pentaho-kettle by pentaho.
the class ScriptValueAddFunctions_SetVariableScopeTest method setRootScopeVariable_TwoLevelHierarchy.
@Test
public void setRootScopeVariable_TwoLevelHierarchy() {
Trans parent = createTrans();
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));
}
use of org.pentaho.di.trans.Trans in project pentaho-kettle by pentaho.
the class ScriptValueAddFunctions_SetVariableScopeTest method createTrans.
private Trans createTrans() {
Trans trans = new Trans();
trans.setLog(mock(LogChannelInterface.class));
trans = spy(trans);
return trans;
}
use of org.pentaho.di.trans.Trans in project pentaho-kettle by pentaho.
the class ScriptValueAddFunctions_SetVariableScopeTest method setParentScopeVariable_ParentIsTrans.
@Test
public void setParentScopeVariable_ParentIsTrans() {
Trans parent = createTrans();
Trans child = createTrans(parent);
ScriptValuesAddedFunctions.setParentScopeVariable(child, VARIABLE_NAME, VARIABLE_VALUE);
verify(child).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
verify(parent).setVariable(eq(VARIABLE_NAME), eq(VARIABLE_VALUE));
}
use of org.pentaho.di.trans.Trans in project pentaho-kettle by pentaho.
the class ScriptValueAddFunctions_SetVariableScopeTest method createTrans.
private Trans createTrans(Trans parent) {
Trans trans = createTrans();
trans.setParent(parent);
trans.setParentVariableSpace(parent);
return trans;
}
Aggregations