Adjust test suite parser update to conform with API changes
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / YangTypesStmtTest.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 YangTypesStmtTest {
20
21     private static final StatementStreamSource TYPEFILE1 = sourceForResource("/semantic-statement-parser/types.yang");
22     private static final StatementStreamSource TYPEFILE2 = sourceForResource(
23         "/semantic-statement-parser/simple-types.yang");
24     private static final StatementStreamSource TYPEFILE3 = sourceForResource(
25         "/semantic-statement-parser/identityreftest.yang");
26
27     private static final StatementStreamSource FILE1 = sourceForResource("/semantic-statement-parser/model/bar.yang");
28     private static final StatementStreamSource FILE2 = sourceForResource("/semantic-statement-parser/model/baz.yang");
29     private static final StatementStreamSource FILE3 = sourceForResource(
30         "/semantic-statement-parser/model/subfoo.yang");
31     private static final StatementStreamSource FILE4 = sourceForResource("/semantic-statement-parser/model/foo.yang");
32
33     @Test
34     public void readAndParseYangFileTest() throws ReactorException {
35         SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
36                 .addSources(TYPEFILE1, TYPEFILE2, TYPEFILE3, FILE1, FILE2, FILE3, FILE4)
37                 .buildEffective();
38         assertNotNull(result);
39     }
40 }