Fix YangModelDependencyInfo handling of arguments
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / parser / rfc7950 / repo / YangModelDependencyInfoTest.java
index 2b07deb5cbb87266f2c4afb631c347fea3a23b02..71fd9a670e83b1a51f9d908d601361473feb657b 100644 (file)
@@ -78,4 +78,24 @@ public class YangModelDependencyInfoTest {
                 "/no-revision/module-without-revision.yang");
         assertNotEquals("hashcode", 31, info.hashCode());
     }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testMalformedImport() throws IOException, YangSyntaxErrorException {
+        YangModelDependencyInfo.forResource(getClass(), "/depinfo-malformed/malformed-import.yang");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testMalformedImportRev() throws IOException, YangSyntaxErrorException {
+        YangModelDependencyInfo.forResource(getClass(), "/depinfo-malformed/malformed-import-rev.yang");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testMalformedModule() throws IOException, YangSyntaxErrorException {
+        YangModelDependencyInfo.forResource(getClass(), "/depinfo-malformed/malformed-module.yang");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testMalformedRev() throws IOException, YangSyntaxErrorException {
+        YangModelDependencyInfo.forResource(getClass(), "/depinfo-malformed/malformed-rev.yang");
+    }
 }