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;
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.model.api.SchemaContext;
17 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
18 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
19 import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
21 public class Bug4231Test {
24 public void test() throws Exception {
25 SchemaContext context = TestUtils.parseYangSources("/bugs/bug4231");
27 assertNotNull(context);
29 QNameModule foo = QNameModule.create(new URI("foo"), QName.parseRevision("2015-09-02"));
31 SchemaPath targetPath = SchemaPath
32 .create(true, QName.create(foo, "augment-target"))
33 .createChild(QName.create(foo, "my-container-in-grouping"))
34 .createChild(QName.create(foo, "l2"));
36 SchemaNode targetNode = SchemaContextUtil.findNodeInSchemaContext(
37 context, targetPath.getPathFromRoot());
38 assertNotNull(targetNode);