final ConfigFile configFile = ConfigFile.read(testYml);
configFile.setEnvironments(new HashMap<String, Environment>());
for (final ProcessDescription processDescription : manifest
.getProcessDescriptions()) {
final Environment env = new Environment();
env.getFiles().setFolder(new String[] { source.getAbsolutePath() });
final List<String> names = new ArrayList<String>();
for (final Processor proc : processDescription.getProcessors()) {
names.add(proc.getName());
}
env.setPipeline(names.toArray(new String[0]));
env.setProcess(processDescription.getOutputFile());
for (final Processor proc : processDescription.getProcessors()) {
final de.matrixweb.smaller.config.Processor processor = new de.matrixweb.smaller.config.Processor();
processor.setSrc(processDescription.getInputFile());
processor.setOptions(new HashMap<String, Object>(proc
.getOptions()));
env.getProcessors().put(proc.getName(), processor);
}
configFile.getEnvironments().put(UUID.randomUUID().toString(), env);
}
configFile.getBuildServer().setEnvironments(
configFile.getEnvironments().keySet().toArray(new String[0]));