Refactored SchemaPath for yang java types. Fixed SchemaPath for augmented nodes types.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / java / org / opendaylight / controller / yang / parser / impl / TestUtils.java
index 5aa620df8936383392ea25d7acea995a7b65fe55..babd0d06f6a7bb217bf12de36b863be569921c56 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.yang.parser.impl;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.net.URI;
 import java.text.DateFormat;
 import java.text.ParseException;
@@ -29,11 +30,14 @@ final class TestUtils {
     private TestUtils() {
     }
 
-    public static Set<Module> loadModules(String resourceDirectory) {
+    public static Set<Module> loadModules(String resourceDirectory) throws FileNotFoundException {
         YangModelParser parser = new YangParserImpl();
         final File testDir = new File(resourceDirectory);
         final String[] fileList = testDir.list();
         final List<File> testFiles = new ArrayList<File>();
+        if(fileList == null) {
+            throw new FileNotFoundException(resourceDirectory);
+        }
         for (int i = 0; i < fileList.length; i++) {
             String fileName = fileList[i];
             testFiles.add(new File(testDir, fileName));