fc73ebd0f1245d2877e9e70687ec7acd5c4e479c
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / YT841Test.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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;
9
10 import static org.hamcrest.CoreMatchers.instanceOf;
11 import static org.hamcrest.MatcherAssert.assertThat;
12
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
17
18 public class YT841Test {
19     private static final QName FOO = QName.create("foo", "2018-01-02", "foo");
20
21     @Test
22     public void testFindDataSchemaNode() throws Exception {
23         final SchemaTreeEffectiveStatement<?> input = StmtTestUtils.parseYangSources("/bugs/YT841/")
24             .getModuleStatement(FOO)
25             .findSchemaTreeNode(FOO, FOO, FOO, QName.create(FOO, "input"))
26             .orElse(null);
27         assertThat(input, instanceOf(InputEffectiveStatement.class));
28     }
29 }