2 * Copyright (c) 2017 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.parser.stmt.rfc7950;
10 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
12 import org.junit.jupiter.api.Test;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
15 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
16 import org.opendaylight.yangtools.yang.stmt.AbstractYangTest;
18 class Bug6884Test extends AbstractYangTest {
21 final var schemaContext = assertEffectiveModelDir("/rfc7950/bug6884/yang1-1");
22 final DataSchemaNode node = schemaContext.findDataTreeChild(foo("sub-root"), foo("sub-foo-2-con")).orElse(null);
23 assertInstanceOf(ContainerSchemaNode.class, node);
27 void testCircularIncludesYang10() {
28 final var schemaContext = assertEffectiveModelDir("/rfc7950/bug6884/circular-includes");
29 DataSchemaNode node = schemaContext.findDataTreeChild(foo("sub-root"), foo("sub-foo-2-con")).orElse(null);
30 assertInstanceOf(ContainerSchemaNode.class, node);
32 node = schemaContext.findDataTreeChild(foo("sub-root-2"), foo("sub-foo-con")).orElse(null);
33 assertInstanceOf(ContainerSchemaNode.class, node);
36 private static QName foo(final String localName) {
37 return QName.create("foo", localName);