* @param container
* @throws Exception
*/
public void testLoadConfig(AugeasTree tree, PluginContainer container) throws Exception {
System.out.print("\tTest mapping of augeas tree to rhq configuration.");
ApacheConfigurationUtil util = new ApacheConfigurationUtil();
for (Components component : Components.values()) {
//get nodes for each component
List<AugeasNode> nodes = component.getAllNodes(tree);
for (int i = 0; i < nodes.size(); i++) {
String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode());
Configuration config =
ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree);
//load configuration for related component and augeas node from tempfolder
Configuration expectedConfig =
util.loadConfiguration(ApacheTestConstants.getConfigFilesPathForLoad() + File.separator
+ component.getComponentName() + String.valueOf(i));
assert config.equals(expectedConfig) : "Unexpected Resource configuration - \nExpected:\n\t"
+ expectedConfig.toString(true) + "\nActual:\n\t" + config.toString(true);
}
}