Fix checkstyle in yang-parser-impl and enable enforcement
[yangtools.git] / yang / yang-parser-impl / 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.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;
19
20 public class Bug6150Test {
21
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");
25
26     @Test
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);
32     }
33
34     @Test
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);
40     }
41
42     @Test
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);
48     }
49 }