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;
20 public class YinFileLeafListStmtTest extends AbstractYinModulesTest {
22 public void testLeafList() {
23 final Module testModule = context.findModules("ietf-netconf-monitoring").iterator().next();
25 final LeafListSchemaNode leafList = (LeafListSchemaNode) testModule.findDataChildByName(
26 QName.create(testModule.getQNameModule(), "netconf-state"),
27 QName.create(testModule.getQNameModule(), "capabilities"),
28 QName.create(testModule.getQNameModule(), "capability")).get();
29 assertNotNull(leafList);
30 assertEquals("uri", leafList.getType().getQName().getLocalName());
31 assertEquals(Optional.of("List of NETCONF capabilities supported by the server."), leafList.getDescription());
32 assertFalse(leafList.isUserOrdered());