2 * Copyright (c) 2014 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.parser.impl.util;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
13 import java.io.InputStream;
14 import org.junit.Test;
16 public class YangModelDependencyInfoTest {
19 public void testModuleWithNoImports() {
20 InputStream stream = getClass().getResourceAsStream("/ietf/ietf-inet-types@2010-09-24.yang");
21 YangModelDependencyInfo info = YangModelDependencyInfo.fromInputStream(stream);
23 assertEquals("ietf-inet-types", info.getName());
24 assertEquals("2010-09-24", info.getFormattedRevision());
25 assertNotNull(info.getDependencies());
30 public void testModuleWithImports() {
31 InputStream stream = getClass().getResourceAsStream("/parse-methods/dependencies/m2@2013-30-09.yang");
32 YangModelDependencyInfo info = YangModelDependencyInfo.fromInputStream(stream);
34 assertEquals("m2", info.getName());
35 assertEquals("2013-30-09", info.getFormattedRevision());
36 assertNotNull(info.getDependencies());
37 assertEquals(2, info.getDependencies().size());