@Test public void testConfigureParameters() throws Exception { TransMeta transMeta = new TransMeta(); transMeta.addParameterDefinition( TEST_PARAM_NAME, DEFAULT_PARAM_VALUE, "This tests a default parameter" ); assertEquals( "Default parameter was not set correctly on TransMeta", DEFAULT_PARAM_VALUE, transMeta.getParameterDefault( TEST_PARAM_NAME ) ); assertEquals( "Parameter value should be blank in TransMeta", "", transMeta.getParameterValue( TEST_PARAM_NAME ) ); Trans trans = new Trans( transMeta ); assertEquals( "Default parameter was not set correctly on Trans", DEFAULT_PARAM_VALUE, trans.getParameterDefault( TEST_PARAM_NAME ) ); assertEquals( "Parameter value should be blank in Trans", "", trans.getParameterValue( TEST_PARAM_NAME ) ); NamedParams params = new NamedParamsDefault(); params.addParameterDefinition( TEST_PARAM_NAME, NOT_DEFAULT_PARAM_VALUE, "This tests a non-default parameter" ); params.setParameterValue( TEST_PARAM_NAME, NOT_DEFAULT_PARAM_VALUE ); Pan.configureParameters( trans, params, transMeta ); assertEquals( "Parameter was not set correctly in Trans", NOT_DEFAULT_PARAM_VALUE, trans.getParameterValue( TEST_PARAM_NAME ) ); assertEquals( "Parameter was not set correctly in TransMeta", NOT_DEFAULT_PARAM_VALUE, transMeta.getParameterValue( TEST_PARAM_NAME ) ); }
protected static void configureParameters( Trans trans, NamedParams optionParams, TransMeta transMeta ) throws UnknownParamException { trans.initializeVariablesFrom( null ); trans.getTransMeta().setInternalKettleVariables( trans ); String[] transParams = trans.listParameters(); for ( String param : transParams ) { String value = optionParams.getParameterValue( param ); if ( value != null ) { trans.setParameterValue( param, value ); transMeta.setParameterValue( param, value ); } } trans.activateParameters(); }
Pan { protected static void configureParameters( Trans trans, NamedParams optionParams, TransMeta transMeta ) throws UnknownParamException { trans.initializeVariablesFrom( null ); trans.getTransMeta().setInternalKettleVariables( trans ); String[] transParams = trans.listParameters(); for ( String param : transParams ) { String value = optionParams.getParameterValue( param ); if ( value != null ) { trans.setParameterValue( param, value ); transMeta.setParameterValue( param, value ); } } trans.activateParameters(); } }
Pan { protected static void configureParameters( Trans trans, NamedParams optionParams, TransMeta transMeta ) throws UnknownParamException { trans.initializeVariablesFrom( null ); trans.getTransMeta().setInternalKettleVariables( trans ); String[] transParams = trans.listParameters(); for ( String param : transParams ) { String value = optionParams.getParameterValue( param ); if ( value != null ) { trans.setParameterValue( param, value ); transMeta.setParameterValue( param, value ); } } trans.activateParameters(); }  }
Pan { protected static void configureParameters( Trans trans, NamedParams optionParams, TransMeta transMeta ) throws UnknownParamException { trans.initializeVariablesFrom( null ); trans.getTransMeta().setInternalKettleVariables( trans ); String[] transParams = trans.listParameters(); for ( String param : transParams ) { String value = optionParams.getParameterValue( param ); if ( value != null ) { trans.setParameterValue( param, value ); transMeta.setParameterValue( param, value ); } } trans.activateParameters(); }  static void main( String[] a ); }
Pan { protected static void configureParameters( Trans trans, NamedParams optionParams, TransMeta transMeta ) throws UnknownParamException { trans.initializeVariablesFrom( null ); trans.getTransMeta().setInternalKettleVariables( trans ); String[] transParams = trans.listParameters(); for ( String param : transParams ) { String value = optionParams.getParameterValue( param ); if ( value != null ) { trans.setParameterValue( param, value ); transMeta.setParameterValue( param, value ); } } trans.activateParameters(); }  static void main( String[] a );  }