Rename binding-util to binding-reflect
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / YangFileStmtTest.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;
9
10 import static org.junit.jupiter.api.Assertions.assertNotNull;
11 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
12
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;
17
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");
23
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");
28
29     @Test
30     void readAndParseYangFileTestModel() throws ReactorException {
31         assertNotNull(RFC7950Reactors.defaultReactor().newBuild().addSources(BAZ, FOO, BAR, SUBFOO).build());
32     }
33
34     @Test
35     void readAndParseYangFileTestModel2() throws ReactorException {
36         assertNotNull(RFC7950Reactors.defaultReactor().newBuild().addSources(BAZ2, FOO2, BAR2, SUBFOO2).build());
37     }
38
39     @Test
40     void readAndParseYangFileTest() {
41         assertEffectiveModel(
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");
50     }
51 }