Adjust test suite parser update to conform with API changes
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug6150Test.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.Assert.assertNotNull;
11 import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
12
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
15 import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
17 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
18
19 public class Bug6150Test {
20
21     private static final StatementStreamSource TARGET = sourceForResource("/bugs/bug6150/target.yang");
22     private static final StatementStreamSource AUGMENT_FIRST = sourceForResource("/bugs/bug6150/aug-first.yang");
23     private static final StatementStreamSource AUGMENT_SECOND = sourceForResource("/bugs/bug6150/aug-second.yang");
24
25     @Test
26     public void effectiveAugmentFirstTest() throws ReactorException {
27         final SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
28                 .addSources(TARGET, AUGMENT_FIRST)
29                 .buildEffective();
30         assertNotNull(result);
31     }
32
33     @Test
34     public void effectiveAugmentSecondTest() throws ReactorException {
35         final SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
36                 .addSources(TARGET, AUGMENT_SECOND)
37                 .buildEffective();
38         assertNotNull(result);
39     }
40
41     @Test
42     public void effectiveAugmentBothTest() throws ReactorException {
43         final SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
44                 .addSources(TARGET, AUGMENT_FIRST, AUGMENT_SECOND)
45                 .buildEffective();
46         assertNotNull(result);
47     }
48 }