Merge "sal-remoterpc-connector: sync ch.qos.logback:logback-classic version"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / xml / to / cnsn / test / XmlAugmentedElementToCnSnTest.java
1 package org.opendaylight.controller.sal.restconf.impl.xml.to.cnsn.test;
2
3 import static org.junit.Assert.assertFalse;
4 import static org.junit.Assert.assertNotNull;
5
6 import java.util.Set;
7
8 import org.junit.Ignore;
9 import org.junit.Test;
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;
15
16 public class XmlAugmentedElementToCnSnTest {
17
18     @Ignore
19     @Test
20     public void loadDataAugmentedSchemaMoreEqualNamesTest() {
21         boolean exceptionCaught = false;
22         try {
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;
27         }
28         
29         assertFalse(exceptionCaught);        
30     }
31     
32     
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);
38
39         assertNotNull(modules);
40         TestUtils.normalizeCompositeNode(compNode, modules, topLevelElementName + ":" + moduleName);
41     }
42
43
44 }