2 * Copyright (c) 2020 PANTHEON.tech, 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.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
12 import static org.junit.jupiter.api.Assertions.assertNull;
14 import com.google.common.collect.Iterables;
16 import org.junit.jupiter.api.Test;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
19 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
20 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
21 import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
25 void testAugmentUnsupported() throws Exception {
26 final SchemaContext context = StmtTestUtils.parseYangSources("/bugs/YT859/", Set.of(),
27 YangParserConfiguration.DEFAULT);
28 assertEquals(4, context.getModules().size());
30 final DataSchemaNode named = Iterables.getOnlyElement(context.findModules("xyzzy"))
31 .findDataChildByName(QName.create("xyzzy", "xyzzy"), QName.create("xyzzy", "named")).orElseThrow();
32 assertNull(assertInstanceOf(ListSchemaNode.class, named).dataChildByName(QName.create("foo", "foo")));