Merge "Removed `which` dependency, now using proper shell builtin."
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / xml / to / cnsn / test / XmlAugmentedElementToCnSnTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sal.restconf.impl.xml.to.cnsn.test;
9
10 import static org.junit.Assert.assertNotNull;
11
12 import java.util.Set;
13
14 import org.junit.Test;
15 import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
16 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
17 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
18 import org.opendaylight.yangtools.yang.model.api.Module;
19
20 public class XmlAugmentedElementToCnSnTest {
21
22     @Test
23     public void loadDataAugmentedSchemaMoreEqualNamesTest() {
24         loadAndNormalizeData("/common/augment/xml/dataa.xml", "/common/augment/yang", "main","cont");
25         loadAndNormalizeData("/common/augment/xml/datab.xml", "/common/augment/yang", "main","cont");
26     }
27
28     private void loadAndNormalizeData(String xmlPath, String yangPath, String topLevelElementName, String moduleName) {
29         CompositeNode compNode = TestUtils.readInputToCnSn(xmlPath, false,
30                 XmlToCompositeNodeProvider.INSTANCE);
31         assertNotNull(compNode);
32         Set<Module> modules = TestUtils.loadModulesFrom(yangPath);
33
34         assertNotNull(modules);
35         TestUtils.normalizeCompositeNode(compNode, modules, topLevelElementName + ":" + moduleName);
36     }
37
38
39 }