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.Assert.assertNotNull;
11 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
16 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
17 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
18 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
20 public class Bug6150Test {
22 private static final StatementStreamSource TARGET = sourceForResource("/bugs/bug6150/target.yang");
23 private static final StatementStreamSource AUGMENT_FIRST = sourceForResource("/bugs/bug6150/aug-first.yang");
24 private static final StatementStreamSource AUGMENT_SECOND = sourceForResource("/bugs/bug6150/aug-second.yang");
27 public void effectiveAugmentFirstTest() throws ReactorException {
28 BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
29 reactor.addSources(TARGET, AUGMENT_FIRST);
30 final SchemaContext result = reactor.buildEffective();
31 assertNotNull(result);
35 public void effectiveAugmentSecondTest() throws ReactorException {
36 BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
37 reactor.addSources(TARGET, AUGMENT_SECOND);
38 final SchemaContext result = reactor.buildEffective();
39 assertNotNull(result);
43 public void effectiveAugmentBothTest() throws ReactorException {
44 BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
45 reactor.addSources(TARGET, AUGMENT_FIRST, AUGMENT_SECOND);
46 final SchemaContext result = reactor.buildEffective();
47 assertNotNull(result);