Remove TestUtils.findModule()
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug1413Test.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.stmt;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertTrue;
12
13 import java.util.Collection;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
16
17 /**
18  * Test ANTLR4 grammar capability to parse unknown node in extension argument
19  * declaration.
20  *
21  * <p>
22  * Note: Everything under unknown node is unknown node.
23  */
24 public class Bug1413Test {
25     @Test
26     public void test() throws Exception {
27         Collection<? extends ExtensionDefinition> extensions = TestUtils.loadModules(
28             getClass().getResource("/bugs/bug1413").toURI())
29                 .findModules("bug1413").iterator().next().getExtensionSchemaNodes();
30         assertEquals(1, extensions.size());
31
32         ExtensionDefinition info = extensions.iterator().next();
33         assertEquals("text", info.getArgument());
34         assertTrue(info.isYinElement());
35     }
36 }