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;
10 import static org.junit.jupiter.api.Assertions.assertNotNull;
11 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
16 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
18 class YangFileStmtTest extends AbstractYangTest {
19 private static final StatementStreamSource BAR = sourceForResource("/model-new/bar.yang");
20 private static final StatementStreamSource BAZ = sourceForResource("/model-new/baz.yang");
21 private static final StatementStreamSource FOO = sourceForResource("/model-new/foo.yang");
22 private static final StatementStreamSource SUBFOO = sourceForResource("/model-new/subfoo.yang");
24 private static final StatementStreamSource BAR2 = sourceForResource("/model/bar.yang");
25 private static final StatementStreamSource BAZ2 = sourceForResource("/model/baz.yang");
26 private static final StatementStreamSource FOO2 = sourceForResource("/model/foo.yang");
27 private static final StatementStreamSource SUBFOO2 = sourceForResource("/model/subfoo.yang");
30 void readAndParseYangFileTestModel() throws ReactorException {
31 assertNotNull(RFC7950Reactors.defaultReactor().newBuild().addSources(BAZ, FOO, BAR, SUBFOO).build());
35 void readAndParseYangFileTestModel2() throws ReactorException {
36 assertNotNull(RFC7950Reactors.defaultReactor().newBuild().addSources(BAZ2, FOO2, BAR2, SUBFOO2).build());
40 void readAndParseYangFileTest() {
42 //basic statements to parse and write
43 "/semantic-statement-parser/test.yang",
44 "/semantic-statement-parser/simple-nodes-semantic.yang",
45 "/semantic-statement-parser/importedtest.yang",
46 "/semantic-statement-parser/foobar.yang",
47 //extension statement to parse and write
48 "/semantic-statement-parser/ext-typedef.yang",
49 "/semantic-statement-parser/ext-use.yang");