see to gets some more detailed info for jenkins intermittent failures of runtime config mods

This commit is contained in:
gtully 2013-10-02 00:31:11 +01:00
parent 0530aacff7
commit 4a01e40cb4
2 changed files with 6 additions and 3 deletions

View File

@ -220,7 +220,7 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
if (configToMonitor.lastModified() > lastModified) {
applyModifications(configToMonitor);
}
} catch (IOException e) {
} catch (Throwable e) {
LOG.error("Failed to determine lastModified time on configuration: " + configToMonitor, e);
}
}

View File

@ -52,11 +52,14 @@ public class RuntimeConfigTestSupport {
protected void applyNewConfig(String configName, String newConfigName, long sleep) throws Exception {
Resource resource = Utils.resourceFromString("org/apache/activemq");
FileOutputStream current = new FileOutputStream(new File(resource.getFile(), configName + ".xml"));
File file = new File(resource.getFile(), configName + ".xml");
FileOutputStream current = new FileOutputStream(file);
FileInputStream modifications = new FileInputStream(new File(resource.getFile(), newConfigName + ".xml"));
modifications.getChannel().transferTo(0, Long.MAX_VALUE, current.getChannel());
current.flush();
LOG.info("Updated: " + current.getChannel());
current.close();
modifications.close();
LOG.info("Updated: " + file);
if (sleep > 0) {
// wait for mods to kick in