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;
13 import org.junit.Test;
14 import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
15 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
16 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
17 import org.opendaylight.yangtools.yang.model.api.Module;
19 public class XmlAugmentedElementToCnSnTest {
22 public void loadDataAugmentedSchemaMoreEqualNamesTest() {
23 loadAndNormalizeData("/common/augment/xml/dataa.xml", "/common/augment/yang", "main", "cont");
24 loadAndNormalizeData("/common/augment/xml/datab.xml", "/common/augment/yang", "main", "cont");
27 private void loadAndNormalizeData(String xmlPath, String yangPath, String topLevelElementName, String moduleName) {
28 CompositeNode compNode = TestUtils.readInputToCnSn(xmlPath, false, XmlToCompositeNodeProvider.INSTANCE);
29 assertNotNull(compNode);
30 Set<Module> modules = TestUtils.loadModulesFrom(yangPath);
32 assertNotNull(modules);
33 TestUtils.normalizeCompositeNode(compNode, modules, topLevelElementName + ":" + moduleName);