29244eff26bffec7120fa00813e24679eff0600a
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / yin / YinFileMetaStmtsTest.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.yin;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12
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.TestUtils;
20
21 public class YinFileMetaStmtsTest {
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 testMetaStatements() throws URISyntaxException {
33         Module testModule = TestUtils.findModule(modules, "ietf-netconf-monitoring");
34         assertNotNull(testModule);
35
36         assertEquals("IETF NETCONF (Network Configuration) Working Group", testModule.getOrganization());
37         assertEquals("WG Web:   <http://tools.ietf.org/wg/netconf/>\n" +
38                 "WG List:  <mailto:netconf@ietf.org>\n" +
39                 "\n" +
40                 "WG Chair: Mehmet Ersue\n" +
41                 "        <mailto:mehmet.ersue@nsn.com>\n" +
42                 "\n" +
43                 "WG Chair: Bert Wijnen\n" +
44                 "        <mailto:bertietf@bwijnen.net>\n" +
45                 "\n" +
46                 "Editor:   Mark Scott\n" +
47                 "        <mailto:mark.scott@ericsson.com>\n" +
48                 "\n" +
49                 "Editor:   Martin Bjorklund\n" +
50                 "        <mailto:mbj@tail-f.com>", testModule.getContact());
51         assertEquals("NETCONF Monitoring Module.\n" + "All elements in this module are read-only.\n" + "\n" +
52                 "Copyright (c) 2010 IETF Trust and the persons identified as\n" + "authors of the code. All rights " +
53                 "reserved.\n" + "\n" + "Redistribution and use in source and binary forms, with or\n" +  "without " +
54                 "modification, is permitted pursuant to, and subject\n" + "to the license terms contained in, the " +
55                 "Simplified BSD\n" + "License set forth in Section 4.c of the IETF Trust's\n" + "Legal Provisions " +
56                 "Relating to IETF Documents\n" + "(http://trustee.ietf.org/license-info).\n" + "\n" + "This version " +
57                 "of this YANG module is part of RFC 6022; see\n" + "the RFC itself for full legal notices.",
58                 testModule.getDescription());
59     }
60 }