Use local variable type inference
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / yin / YinFileLeafListStmtTest.java
1 /*
2  * Copyright (c) 2016 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.yangtools.yang.stmt.yin;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertNotNull;
13
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
20 public class YinFileLeafListStmtTest extends AbstractYinModulesTest {
21     @Test
22     public void testLeafList() {
23         final Module testModule = context.findModules("ietf-netconf-monitoring").iterator().next();
24
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());
33     }
34 }