if (file.exists())
{
file.delete();
}
PropertiesConfiguration config = new PropertiesConfiguration();
config.setFile(file);
FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
strategy.setRefreshDelay(500);
config.setReloadingStrategy(strategy);
assertNull("Initial value", config.getString("string"));
// change the file
FileWriter out = new FileWriter(file);
out.write("string=value1");
out.flush();
out.close();
Thread.sleep(2000);
// test the automatic reloading
assertEquals("Modified value with enabled reloading", "value1", config.getString("string"));
}