Search in sources :

Example 41 with Trans

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));
}
Also used : Trans(org.pentaho.di.trans.Trans) Test(org.junit.Test)

Example 42 with Trans

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));
}
Also used : Trans(org.pentaho.di.trans.Trans) Test(org.junit.Test)

Example 43 with Trans

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;
}
Also used : Trans(org.pentaho.di.trans.Trans) LogChannelInterface(org.pentaho.di.core.logging.LogChannelInterface)

Example 44 with 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));
}
Also used : Trans(org.pentaho.di.trans.Trans) Test(org.junit.Test)

Example 45 with Trans

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;
}
Also used : Trans(org.pentaho.di.trans.Trans)

Aggregations

Trans (org.pentaho.di.trans.Trans)307 TransMeta (org.pentaho.di.trans.TransMeta)210 StepMeta (org.pentaho.di.trans.step.StepMeta)118 Test (org.junit.Test)95 StepInterface (org.pentaho.di.trans.step.StepInterface)92 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)84 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)81 TransHopMeta (org.pentaho.di.trans.TransHopMeta)77 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)73 RowStepCollector (org.pentaho.di.trans.RowStepCollector)71 KettleException (org.pentaho.di.core.exception.KettleException)65 RowProducer (org.pentaho.di.trans.RowProducer)58 DummyTransMeta (org.pentaho.di.trans.steps.dummytrans.DummyTransMeta)54 TransPreviewProgressDialog (org.pentaho.di.ui.trans.dialog.TransPreviewProgressDialog)48 InjectorMeta (org.pentaho.di.trans.steps.injector.InjectorMeta)47 EnterTextDialog (org.pentaho.di.ui.core.dialog.EnterTextDialog)47 PreviewRowsDialog (org.pentaho.di.ui.core.dialog.PreviewRowsDialog)47 EnterNumberDialog (org.pentaho.di.ui.core.dialog.EnterNumberDialog)42 PrintWriter (java.io.PrintWriter)34 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)29