1 package org.opendaylight.controller.sal.restconf.impl.xml.to.cnsn.test;
3 import static org.junit.Assert.assertFalse;
4 import static org.junit.Assert.assertNotNull;
8 import org.junit.Ignore;
10 import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
11 import org.opendaylight.controller.sal.restconf.impl.ResponseException;
12 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
13 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
14 import org.opendaylight.yangtools.yang.model.api.Module;
16 public class XmlAugmentedElementToCnSnTest {
20 public void loadDataAugmentedSchemaMoreEqualNamesTest() {
21 boolean exceptionCaught = false;
23 loadAndNormalizeData("/common/augment/xml/dataa.xml", "/common/augment/yang", "main","cont");
24 loadAndNormalizeData("/common/augment/xml/datab.xml", "/common/augment/yang", "main","cont");
25 } catch (ResponseException e) {
26 exceptionCaught = true;
29 assertFalse(exceptionCaught);
33 private void loadAndNormalizeData(String xmlPath, String yangPath, String topLevelElementName, String moduleName) {
34 CompositeNode compNode = TestUtils.readInputToCnSn(xmlPath, false,
35 XmlToCompositeNodeProvider.INSTANCE);
36 assertNotNull(compNode);
37 Set<Module> modules = TestUtils.loadModulesFrom(yangPath);
39 assertNotNull(modules);
40 TestUtils.normalizeCompositeNode(compNode, modules, topLevelElementName + ":" + moduleName);