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
9 package org.opendaylight.yangtools.yang.stmt;
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertNotNull;
13 import static org.junit.Assert.assertTrue;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
19 public class Bug7038Test {
21 public void unknownNodeTest() throws Exception {
22 final SchemaContext context = StmtTestUtils.parseYangSources("/bugs/bug7038");
23 assertNotNull(context);
24 assertEquals(1, context.getUnknownSchemaNodes().size());
28 public void testYang11() throws Exception {
29 final SchemaContext context = StmtTestUtils.parseYangSources("/bugs/bug7038/yang11");
30 assertNotNull(context);
34 public void testYang10() throws Exception {
36 StmtTestUtils.parseYangSources("/bugs/bug7038/yang10");
37 } catch (final SomeModifiersUnresolvedException e) {
38 assertTrue(e.getCause().getMessage().startsWith("REQUIRE_INSTANCE is not valid for TYPE"));