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.io.IOException;
14 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.model.api.SchemaContext;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
20 import org.opendaylight.yangtools.yang.stmt.TestUtils;
21 import org.xml.sax.SAXException;
23 public class YinFileMetaStmtsTest {
25 private SchemaContext context;
28 public void init() throws URISyntaxException, ReactorException, SAXException, IOException {
29 context = TestUtils.loadYinModules(getClass().getResource("/semantic-statement-parser/yin/modules").toURI());
30 assertEquals(9, context.getModules().size());
34 public void testMetaStatements() throws URISyntaxException {
35 Module testModule = TestUtils.findModule(context, "ietf-netconf-monitoring").get();
36 assertNotNull(testModule);
38 assertEquals("IETF NETCONF (Network Configuration) Working Group", testModule.getOrganization());
39 assertEquals("WG Web: <http://tools.ietf.org/wg/netconf/>\n" +
40 "WG List: <mailto:netconf@ietf.org>\n" +
42 "WG Chair: Mehmet Ersue\n" +
43 " <mailto:mehmet.ersue@nsn.com>\n" +
45 "WG Chair: Bert Wijnen\n" +
46 " <mailto:bertietf@bwijnen.net>\n" +
48 "Editor: Mark Scott\n" +
49 " <mailto:mark.scott@ericsson.com>\n" +
51 "Editor: Martin Bjorklund\n" +
52 " <mailto:mbj@tail-f.com>", testModule.getContact());
53 assertEquals("NETCONF Monitoring Module.\n" + "All elements in this module are read-only.\n" + "\n" +
54 "Copyright (c) 2010 IETF Trust and the persons identified as\n" + "authors of the code. All rights " +
55 "reserved.\n" + "\n" + "Redistribution and use in source and binary forms, with or\n" + "without " +
56 "modification, is permitted pursuant to, and subject\n" + "to the license terms contained in, the " +
57 "Simplified BSD\n" + "License set forth in Section 4.c of the IETF Trust's\n" + "Legal Provisions " +
58 "Relating to IETF Documents\n" + "(http://trustee.ietf.org/license-info).\n" + "\n" + "This version " +
59 "of this YANG module is part of RFC 6022; see\n" + "the RFC itself for full legal notices.",
60 testModule.getDescription());