Merge changes I6265d077,I0be9473e,If481ebdb
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / impl / TwoRevisionsTest.java
1 /*
2  * Copyright (c) 2014 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.parser.impl;
9
10 import org.junit.Test;
11 import org.opendaylight.yangtools.yang.model.api.Module;
12 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
13 import org.opendaylight.yangtools.yang.model.parser.api.YangModelParser;
14
15 import java.util.ArrayList;
16 import java.util.List;
17 import java.util.Set;
18
19 import static org.junit.Assert.assertEquals;
20
21 public class TwoRevisionsTest {
22
23     @Test
24     public void testTwoRevisions() throws Exception {
25         YangModelParser parser = new YangParserImpl();
26
27         Set<Module> modules = TestUtils.loadModules(getClass().getResource("/ietf").getPath(), parser);
28         assertEquals(2, TestUtils.findModules(modules, "network-topology").size());
29
30         SchemaContext schemaContext = parser.resolveSchemaContext(modules);
31         assertEquals(2, TestUtils.findModules(schemaContext.getModules(), "network-topology").size());
32
33     }
34
35 }