Bug 4656: Yang parser does not determine configuration true or false properly
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / test / yin / YinFileHeaderStmtsTest.java
1 /*
2  * Copyright (c) 2015 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.test.yin;
9
10 import static org.junit.Assert.assertEquals;
11
12 import java.net.URI;
13 import java.net.URISyntaxException;
14 import java.util.Set;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.opendaylight.yangtools.yang.model.api.Module;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
19 import org.opendaylight.yangtools.yang.stmt.retest.TestUtils;
20
21 public class YinFileHeaderStmtsTest {
22
23     private Set<Module> modules;
24
25     @Before
26     public void init() throws URISyntaxException, ReactorException {
27         modules = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI());
28         assertEquals(9, modules.size());
29     }
30
31     @Test
32     public void testYinFileHeader() throws URISyntaxException {
33         Module testModule = TestUtils.findModule(modules, "config");
34
35         assertEquals("1", testModule.getYangVersion());
36         assertEquals(new URI("urn:opendaylight:params:xml:ns:yang:controller:config"), testModule.getNamespace());
37         assertEquals("config", testModule.getPrefix());
38     }
39
40 }