2 * Copyright (c) 2016 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.stmt.yin;
10 import static org.junit.Assert.assertEquals;
12 import java.io.IOException;
14 import java.net.URISyntaxException;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.opendaylight.yangtools.yang.common.YangVersion;
18 import org.opendaylight.yangtools.yang.model.api.Module;
19 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
20 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
21 import org.opendaylight.yangtools.yang.stmt.TestUtils;
22 import org.xml.sax.SAXException;
24 public class YinFileHeaderStmtsTest {
26 private SchemaContext modules;
29 public void init() throws URISyntaxException, ReactorException, SAXException, IOException {
30 modules = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI());
31 assertEquals(9, modules.getModules().size());
35 public void testYinFileHeader() throws URISyntaxException {
36 Module testModule = TestUtils.findModule(modules, "config").get();
38 assertEquals(YangVersion.VERSION_1, testModule.getYangVersion());
39 assertEquals(new URI("urn:opendaylight:params:xml:ns:yang:controller:config"), testModule.getNamespace());
40 assertEquals("config", testModule.getPrefix());