2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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;
10 import static org.junit.Assert.assertNotNull;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.common.QNameModule;
16 import org.opendaylight.yangtools.yang.common.Revision;
17 import org.opendaylight.yangtools.yang.model.api.Module;
18 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
19 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
20 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
21 import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
23 public class YT841Test {
24 private static final QNameModule FOO = QNameModule.create(URI.create("foo"), Revision.of("2018-01-02"));
27 public void testFindDataSchemaNode() throws Exception {
28 final SchemaContext context = StmtTestUtils.parseYangSources("/bugs/YT841/");
29 final Module foo = context.findModule(FOO).get();
31 final SchemaNode target = SchemaContextUtil.findDataSchemaNode(context, SchemaPath.create(true,
32 QName.create(FOO, "foo"),
33 QName.create(FOO, "foo"),
34 QName.create(FOO, "foo"),
35 QName.create(FOO, "input")));
36 assertNotNull(target);