@Test public void testInit() throws Exception { KettleVariablesList variablesList = KettleVariablesList.getInstance(); variablesList.init(); //See PDI-14522 boolean actual = Boolean.valueOf( variablesList.getDefaultValueMap().get( Const.VFS_USER_DIR_IS_ROOT ) ); assertEquals( false, actual ); String vfsUserDirIsRootDefaultMessage = "Set this variable to true if VFS should treat the user directory" + " as the root directory when connecting via ftp. Defaults to false."; assertEquals( variablesList.getDescriptionMap().get( Const.VFS_USER_DIR_IS_ROOT ), vfsUserDirIsRootDefaultMessage ); }
KettleVariablesList variablesList = getInstance(); String defaultValue = XMLHandler.getTagValue( varNode, "default-value" ); variablesList.getDescriptionMap().put( variable, description ); variablesList.getDefaultValueMap().put( variable, defaultValue );
@Test public void testInit_closeInputStream() throws Exception { KettleVariablesList.init(); RandomAccessFile fos = null; try { File file = new File( Const.KETTLE_VARIABLES_FILE ); if ( file.exists() ) { fos = new RandomAccessFile( file, "rw" ); } } catch ( FileNotFoundException | SecurityException e ) { fail( "the file with properties should be unallocated" ); } finally { if ( fos != null ) { fos.close(); } } } }
KettleVariablesList variablesList = KettleVariablesList.getInstance(); for ( String key : variablesList.getDescriptionMap().keySet() ) { if ( Utils.isEmpty( (String) properties.get( key ) ) ) { String defaultValue = variablesList.getDefaultValueMap().get( key ); properties.put( key, Const.NVL( defaultValue, "" ) ); String key = keys.get( i ); String value = properties.getProperty( key, "" ); String description = Const.NVL( variablesList.getDescriptionMap().get( key ), "" );
KettleVariablesList.init();