for (ToolConfig config : tool.getConfigs()) {
log.info("*** CHECKING CONFIG: " + config.getUrl());
configs.add(config.getUrl());
String initDir = config.getInitialisationDir();
IMigrationEngine engine = ToolRegistry.getInstance()
.getAllEngines().get(config.getEngine());
if (initDir == null) {
log.error("No initDir for " + config.getUrl());
initResults.put(config.getUrl(), "no init directory specified");
continue;
}
File directory = new File(initDir);
if (directory.isDirectory()) {
try {
for (File f : directory.listFiles()) {
log.debug("testing " + config.getUrl() + " with file "
+ f.getName());
byte[] data = FileUtils.getBytesFromFile(f);
MigrationResult r = engine.migrate(data, "minimee/"+ config.getUrl(), "");
if (!r.isSuccessful()) {
log.warn(r.getReport());
initResults.put(config.getUrl(), "FAILED: "
+ r.getReport());
} else {