BUG-866: improved test resource loading 92/10292/1
authorMartin Vitez <mvitez@cisco.com>
Tue, 26 Aug 2014 10:17:19 +0000 (12:17 +0200)
committerMartin Vitez <mvitez@cisco.com>
Tue, 26 Aug 2014 10:17:19 +0000 (12:17 +0200)
Change-Id: I479299cacf0b2070fac6325a0d0165362ee0d0fa
Signed-off-by: Martin Vitez <mvitez@cisco.com>
yang/yang-data-codec-gson/src/test/java/org/opendaylight/yangtools/yang/data/codec/gson/StreamToNormalizedNodeTest.java

index e38c63bbf5ce375a175d5eaa667fbcbc3d49d9dc..f51179e6cc02cbd3dee149f836d153c28f5a5730 100644 (file)
@@ -15,6 +15,7 @@ import java.io.FileReader;
 import java.io.IOException;
 import java.io.StringReader;
 import java.io.StringWriter;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
@@ -120,9 +121,9 @@ public class StreamToNormalizedNodeTest {
         LOG.debug("Serialized JSON: {}", writer.toString());
     }
 
-    private static SchemaContext loadModules(final String resourceDirectory) throws IOException {
+    private static SchemaContext loadModules(final String resourceDirectory) throws IOException, URISyntaxException {
         YangContextParser parser = new YangParserImpl();
-        String path = StreamToNormalizedNodeTest.class.getResource(resourceDirectory).getPath();
+        URI path = StreamToNormalizedNodeTest.class.getResource(resourceDirectory).toURI();
         final File testDir = new File(path);
         final String[] fileList = testDir.list();
         final List<File> testFiles = new ArrayList<File>();