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.rfc7950.reactor.RFC7950Reactors;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
17 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
19 public class YangTypesStmtTest {
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");
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");
34 public void readAndParseYangFileTest() throws ReactorException {
35 SchemaContext result = RFC7950Reactors.defaultReactor().newBuild()
36 .addSources(TYPEFILE1, TYPEFILE2, TYPEFILE3, FILE1, FILE2, FILE3, FILE4)
38 assertNotNull(result);