Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-parser-rfc7950 / 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.Optional;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.model.api.Module;
17 import org.opendaylight.yangtools.yang.stmt.TestUtils;
18
19 public class YinFileMetaStmtsTest extends AbstractYinModulesTest {
20
21     @Test
22     public void testMetaStatements() throws URISyntaxException {
23         Module testModule = TestUtils.findModule(context, "ietf-netconf-monitoring").get();
24         assertNotNull(testModule);
25
26         assertEquals(Optional.of("IETF NETCONF (Network Configuration) Working Group"), testModule.getOrganization());
27         assertEquals(Optional.of("WG Web:   <http://tools.ietf.org/wg/netconf/>\n"
28                 + "WG List:  <mailto:netconf@ietf.org>\n"
29                 + "\n"
30                 + "WG Chair: Mehmet Ersue\n"
31                 + "        <mailto:mehmet.ersue@nsn.com>\n"
32                 + "\n"
33                 + "WG Chair: Bert Wijnen\n"
34                 + "        <mailto:bertietf@bwijnen.net>\n"
35                 + "\n"
36                 + "Editor:   Mark Scott\n"
37                 + "        <mailto:mark.scott@ericsson.com>\n"
38                 + "\n"
39                 + "Editor:   Martin Bjorklund\n"
40                 + "        <mailto:mbj@tail-f.com>"), testModule.getContact());
41         assertEquals(Optional.of("NETCONF Monitoring Module.\n" + "All elements in this module are read-only.\n" + "\n"
42                 + "Copyright (c) 2010 IETF Trust and the persons identified as\n" + "authors of the code. All rights "
43                 + "reserved.\n" + "\n" + "Redistribution and use in source and binary forms, with or\n" +  "without "
44                 + "modification, is permitted pursuant to, and subject\n" + "to the license terms contained in, the "
45                 + "Simplified BSD\n" + "License set forth in Section 4.c of the IETF Trust's\n" + "Legal Provisions "
46                 + "Relating to IETF Documents\n" + "(http://trustee.ietf.org/license-info).\n" + "\n" + "This version "
47                 + "of this YANG module is part of RFC 6022; see\n" + "the RFC itself for full legal notices."),
48                 testModule.getDescription());
49     }
50 }