@Test public void testReadLastXmlConfiguration() throws ConfigurationException { testCreateConfig.load(getClass().getResourceAsStream("/testYangConfig.xml")); List<YangElement> elements = utils.readXmlConfiguration(testCreateConfig, "controller"); List<YangElement> expected = ImmutableList.of( new YangElement("controller", ImmutableMap.of("id", "tcp:1.1.1.1:1", "ip-address", "1.1.1.1")), new YangElement("controller", ImmutableMap.of("id", "tcp:2.2.2.2:2", "ip-address", "2.2.2.2"))); assertEquals("Wrong elements collected", expected, elements); }
public List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path) { List<YangElement> elements = new ArrayList<>(); String key = nullIsNotFound(findPath(cfg, path), "Configuration does not contain desired path"); getElements(cfg.configurationsAt(key), elements, key, cfg, path, key); return ImmutableList.copyOf(elements); }
YangXmlUtils { public List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path) { List<YangElement> elements = new ArrayList<>(); String key = nullIsNotFound(findPath(cfg, path), "Configuration does not contain desired path"); getElements(cfg.configurationsAt(key), elements, key, cfg, path, key); return ImmutableList.copyOf(elements); } }
YangXmlUtils { public List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path) { List<YangElement> elements = new ArrayList<>(); String key = nullIsNotFound(findPath(cfg, path), "Configuration does not contain desired path"); getElements(cfg.configurationsAt(key), elements, key, cfg, path, key); return ImmutableList.copyOf(elements); } protected  YangXmlUtils(); }
YangXmlUtils { public List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path) { List<YangElement> elements = new ArrayList<>(); String key = nullIsNotFound(findPath(cfg, path), "Configuration does not contain desired path"); getElements(cfg.configurationsAt(key), elements, key, cfg, path, key); return ImmutableList.copyOf(elements); } protected  YangXmlUtils(); XMLConfiguration getXmlConfiguration(String file, Map<String, String> values); XMLConfiguration getXmlConfiguration(String file, List<YangElement> elements); List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path); static YangXmlUtils getInstance(); String getString(XMLConfiguration cfg); XMLConfiguration loadXml(InputStream xmlStream); }
YangXmlUtils { public List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path) { List<YangElement> elements = new ArrayList<>(); String key = nullIsNotFound(findPath(cfg, path), "Configuration does not contain desired path"); getElements(cfg.configurationsAt(key), elements, key, cfg, path, key); return ImmutableList.copyOf(elements); } protected  YangXmlUtils(); XMLConfiguration getXmlConfiguration(String file, Map<String, String> values); XMLConfiguration getXmlConfiguration(String file, List<YangElement> elements); List<YangElement> readXmlConfiguration(HierarchicalConfiguration cfg, String path); static YangXmlUtils getInstance(); String getString(XMLConfiguration cfg); XMLConfiguration loadXml(InputStream xmlStream); final Logger log; }