.registerChildDefaultsHandler(
FileBasedBuilderProperties.class,
new CopyObjectDefaultHandler(
new FileBasedBuilderParametersImpl()
.setReloadingDetectorFactory(detectorFactory))));
CombinedConfiguration config = builder.getConfiguration();
assertEquals("Wrong initial value (1)", 0,
config.getInt(testProperty(1)));
assertEquals("Wrong initial value (2)", 0,
config.getInt(testProperty(2)));
writeReloadFile(xmlConf1, 1, 1);
builder.getReloadingController().checkForReloading(null);
config = builder.getConfiguration();
assertEquals("Updated value not reloaded (1)", 1,
config.getInt(testProperty(1)));
assertEquals("Value modified", 0, config.getInt(testProperty(2)));
writeReloadFile(xmlConf2, 2, 2);
builder.getReloadingController().checkForReloading(null);
config = builder.getConfiguration();
assertEquals("Wrong value for config 1", 1,
config.getInt(testProperty(1)));
assertEquals("Updated value not reloaded (2)", 2,
config.getInt(testProperty(2)));
}