/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.stmt.test; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; import org.opendaylight.yangtools.yang.parser.spi.source.SourceException; import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource; import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor; import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext; import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline; import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl; public class AugmentSimplestTest { private static final YangStatementSourceImpl AUGMENTED = new YangStatementSourceImpl("/semantic-statement-parser/augmented.yang", false); private static final YangStatementSourceImpl ROOT = new YangStatementSourceImpl("/semantic-statement-parser/root.yang", false); @Test public void readAndParseYangFileTest() throws SourceException, ReactorException { CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(); addSources(reactor, AUGMENTED, ROOT); EffectiveModelContext result = reactor.build(); assertNotNull(result); } private static void addSources(final CrossSourceStatementReactor.BuildAction reactor, final StatementStreamSource... sources) { for (StatementStreamSource source : sources) { reactor.addSource(source); } } }