2 * Copyright (c) 2015 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
9 package org.opendaylight.yangtools.yang.stmt.test;
11 import static org.junit.Assert.assertNotNull;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
15 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
16 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
17 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
18 import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
19 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
20 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
22 public class AugmentSimplestTest {
24 private static final YangStatementSourceImpl AUGMENTED = new YangStatementSourceImpl("/semantic-statement-parser/augmented.yang", false);
25 private static final YangStatementSourceImpl ROOT = new YangStatementSourceImpl("/semantic-statement-parser/root.yang", false);
28 public void readAndParseYangFileTest() throws SourceException, ReactorException {
29 CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
30 addSources(reactor, AUGMENTED, ROOT);
32 EffectiveModelContext result = reactor.build();
33 assertNotNull(result);
36 private static void addSources(final CrossSourceStatementReactor.BuildAction reactor, final StatementStreamSource... sources) {
37 for (StatementStreamSource source : sources) {
38 reactor.addSource(source);