2 * Copyright (c) 2016 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.yangtools.yang.stmt.yin;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertNotNull;
14 import java.util.Optional;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
18 import org.opendaylight.yangtools.yang.model.api.Module;
19 import org.opendaylight.yangtools.yang.stmt.TestUtils;
21 public class YinFileLeafListStmtTest extends AbstractYinModulesTest {
24 public void testLeafList() {
25 final Module testModule = TestUtils.findModule(context, "ietf-netconf-monitoring").get();
27 final LeafListSchemaNode leafList = (LeafListSchemaNode) testModule.findDataChildByName(
28 QName.create(testModule.getQNameModule(), "netconf-state"),
29 QName.create(testModule.getQNameModule(), "capabilities"),
30 QName.create(testModule.getQNameModule(), "capability")).get();
31 assertNotNull(leafList);
32 assertEquals("uri", leafList.getType().getQName().getLocalName());
33 assertEquals(Optional.of("List of NETCONF capabilities supported by the server."), leafList.getDescription());
34 assertFalse(leafList.isUserOrdered());