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;
11 import static org.junit.Assert.assertNotNull;
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.TestUtils;
21 public class YinFileMetaStmtsTest {
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 testMetaStatements() throws URISyntaxException {
33 Module testModule = TestUtils.findModule(modules, "ietf-netconf-monitoring");
34 assertNotNull(testModule);
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" +
40 "WG Chair: Mehmet Ersue\n" +
41 " <mailto:mehmet.ersue@nsn.com>\n" +
43 "WG Chair: Bert Wijnen\n" +
44 " <mailto:bertietf@bwijnen.net>\n" +
46 "Editor: Mark Scott\n" +
47 " <mailto:mark.scott@ericsson.com>\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());