2 * Copyright (c) 2015 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.test.yin;
10 import static org.junit.Assert.assertEquals;
13 import java.net.URISyntaxException;
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;
21 public class YinFileHeaderStmtsTest {
23 private Set<Module> modules;
26 public void init() throws URISyntaxException, ReactorException {
27 modules = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI());
28 assertEquals(9, modules.size());
32 public void testYinFileHeader() throws URISyntaxException {
33 Module testModule = TestUtils.findModule(modules, "config");
35 assertEquals("1", testModule.getYangVersion());
36 assertEquals(new URI("urn:opendaylight:params:xml:ns:yang:controller:config"), testModule.getNamespace());
37 assertEquals("config", testModule.getPrefix());