public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
    meta = (ScriptValuesMetaMod) smi;
    data = (ScriptValuesModData) sdi;

    if ( super.init( smi, sdi ) ) {

      // Add init code here.
      // Get the actual Scripts from our MetaData
      jsScripts = meta.getJSScripts();
      for ( int j = 0; j < jsScripts.length; j++ ) {
        switch ( jsScripts[ j ].getScriptType() ) {
          case ScriptValuesScript.TRANSFORM_SCRIPT:
            strTransformScript = jsScripts[ j ].getScript();
            break;
          case ScriptValuesScript.START_SCRIPT:
            strStartScript = jsScripts[ j ].getScript();
            break;
          case ScriptValuesScript.END_SCRIPT:
            strEndScript = jsScripts[ j ].getScript();
            break;
          default:
            break;
        }
      }

      return true;
    }
    return false;
  }
@Test
  public void variableIsSetInScopeOfStep() throws Exception {
    ScriptValuesMod step = StepMockUtil.getStep( ScriptValuesMod.class, ScriptValuesMetaMod.class, "test" );

    RowMeta input = new RowMeta();
    input.addValueMeta( new ValueMetaString( "str" ) );
    step.setInputRowMeta( input );

    step = spy( step );
    doReturn( new Object[] { "" } ).when( step ).getRow();

    ScriptValuesMetaMod meta = new ScriptValuesMetaMod();
    meta.setCompatible( false );
    meta.allocate( 1 );
    meta.setFieldname( new String[] { "str" } );
    meta.setType( new int[] { ValueMetaInterface.TYPE_STRING } );
    meta.setReplace( new boolean[] { true } );

    meta.setJSScripts( new ScriptValuesScript[] {
      new ScriptValuesScript( ScriptValuesScript.TRANSFORM_SCRIPT, "script",
        "setVariable('temp', 'pass', 'r');\nstr = getVariable('temp', 'fail');" )
    } );

    ScriptValuesModData data = new ScriptValuesModData();
    step.init( meta, data );

    Object[] expectedRow = { "pass" };
    Object[] row = TransTestingUtil.execute( step, meta, data, 1, false ).get( 0 );
    TransTestingUtil.assertResult( expectedRow, row );
  }