BUG-990: fixed deserialization of enums.
[yangtools.git] / code-generator / binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / generator / impl / GenTypesSubSetTest.java
index 006aeea2aafc51d65817114dae5447e4280831d9..3f5295b02f7135ddf6ee1804f0af199bbcdd0dbc 100644 (file)
@@ -7,9 +7,13 @@
  */
 package org.opendaylight.yangtools.sal.binding.generator.impl;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 
 import java.io.File;
+import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -27,12 +31,12 @@ import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
 public class GenTypesSubSetTest {
 
     private final static List<File> yangModels = new ArrayList<>();
-    private final static String yangModelsFolder = AugmentedTypeTest.class
-            .getResource("/leafref-test-models").getPath();
+    private final static URL yangModelsFolder = AugmentedTypeTest.class
+            .getResource("/leafref-test-models");
 
     @BeforeClass
-    public static void loadTestResources() {
-        final File augFolder = new File(yangModelsFolder);
+    public static void loadTestResources() throws URISyntaxException {
+        final File augFolder = new File(yangModelsFolder.toURI());
 
         for (final File fileEntry : augFolder.listFiles()) {
             if (fileEntry.isFile()) {
@@ -64,7 +68,7 @@ public class GenTypesSubSetTest {
         assertNotNull("genTypes is null", genTypes);
         assertFalse("genTypes is empty", genTypes.isEmpty());
         assertEquals("Expected Generated Types from provided sub set of " +
-                "modules should be 23!", 25,
+                "modules should be 23!", 23,
                 genTypes.size());
     }
 
@@ -93,7 +97,6 @@ public class GenTypesSubSetTest {
         final List<Type> genTypes = bindingGen.generateTypes(context, toGenModules);
         assertNotNull("genTypes is null", genTypes);
         assertFalse("genTypes is empty", genTypes.isEmpty());
-        assertEquals("Expected Generated Types from provided sub set of "  +
-                "modules should be 25!", 28, genTypes.size());
+        assertEquals("Expected Generated Types", 24, genTypes.size());
     }
 }