out.write("string=value1");
out.flush();
out.close();
// load the configuration
PropertiesConfiguration config = new PropertiesConfiguration("target/testReload.properties");
VFSFileChangedReloadingStrategy strategy = new VFSFileChangedReloadingStrategy();
strategy.setRefreshDelay(500);
config.setReloadingStrategy(strategy);
assertEquals("Initial value", "value1", config.getString("string"));
Thread.sleep(2000);
// change the file
out = new FileWriter(file);
out.write("string=value2");
out.flush();
out.close();
// test the automatic reloading
assertEquals("Modified value with enabled reloading", "value2", config.getString("string"));
}