2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.restconf.impl.xml.to.cnsn.test;
10 import static org.junit.Assert.assertNotNull;
11 import static org.junit.Assert.assertTrue;
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.data.api.Node;
19 import org.opendaylight.yangtools.yang.model.api.Module;
21 public class XmlAugmentedElementToCnSnTest {
24 public void loadDataAugmentedSchemaMoreEqualNamesTest() {
25 loadAndNormalizeData("/common/augment/xml/dataa.xml", "/common/augment/yang", "main", "cont");
26 loadAndNormalizeData("/common/augment/xml/datab.xml", "/common/augment/yang", "main", "cont");
29 private void loadAndNormalizeData(String xmlPath, String yangPath, String topLevelElementName, String moduleName) {
30 Node<?> node = TestUtils.readInputToCnSn(xmlPath, false,
31 XmlToCompositeNodeProvider.INSTANCE);
32 assertTrue(node instanceof CompositeNode);
33 CompositeNode cnSn = (CompositeNode)node;
35 Set<Module> modules = TestUtils.loadModulesFrom(yangPath);
37 assertNotNull(modules);
38 TestUtils.normalizeCompositeNode(cnSn, modules, topLevelElementName + ":" + moduleName);