1 package org.opendaylight.yangtools.yang.stmt.test;
4 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
5 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
6 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
7 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
8 import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
9 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
11 import static org.junit.Assert.assertNotNull;
13 public class AugmentSimplestTest {
15 private static final TestYangFileStatementSource AUGMENTED = new TestYangFileStatementSource("/semantic-statement-parser/augmented.yang");
16 private static final TestYangFileStatementSource ROOT = new TestYangFileStatementSource("/semantic-statement-parser/root.yang");
19 public void readAndParseYangFileTest() throws SourceException, ReactorException {
20 CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
21 addSources(reactor, AUGMENTED, ROOT);
23 EffectiveModelContext result = reactor.build();
24 assertNotNull(result);
27 private void addSources(CrossSourceStatementReactor.BuildAction reactor, StatementStreamSource... sources) {
28 for (StatementStreamSource source : sources) {
29 reactor.addSource(source);