BUG-997 Add tests for shared schema context and fix dependency resolution bug
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / parser / impl / util / YangModelDependencyInfoTest.java
index 6e6b73b7435599763cbbee552f03b9e633c7eb19..461d8579f5d8717014112568e384cd3fe3701d71 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.yangtools.yang.parser.impl.util;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 import java.io.InputStream;
 import org.junit.Test;
@@ -24,8 +25,7 @@ public class YangModelDependencyInfoTest {
         assertEquals("2010-09-24", info.getFormattedRevision());
         assertNotNull(info.getDependencies());
     }
-    
-    
+
     @Test
     public void testModuleWithImports() {
         InputStream stream = getClass().getResourceAsStream("/parse-methods/dependencies/m2@2013-30-09.yang");
@@ -37,4 +37,12 @@ public class YangModelDependencyInfoTest {
         assertEquals(2, info.getDependencies().size());
     }
 
+    @Test
+    public void testModuleWithoutRevision() {
+        InputStream stream = getClass().getResourceAsStream("/no-revision/module-without-revision.yang");
+        YangModelDependencyInfo info = YangModelDependencyInfo.fromInputStream(stream);
+        assertNotNull(info);
+        assertEquals("module-without-revision", info.getName());
+        assertNull(info.getFormattedRevision());
+    }
 }