Refactored parsing of YANG uses statement.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-generator-impl / src / test / java / org / opendaylight / controller / sal / binding / generator / impl / GenEnumResolvingTest.java
index 6a0e1141e5c15c26ced32c0a0010e4155a2b305d..f8cf951c17a55af6e122474c815e88c89db1b9d0 100644 (file)
@@ -7,6 +7,13 @@
  */
 package org.opendaylight.controller.sal.binding.generator.impl;
 
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
 import org.junit.Test;
 import org.opendaylight.controller.binding.generator.util.ReferencedTypeImpl;
 import org.opendaylight.controller.sal.binding.generator.api.BindingGenerator;
@@ -19,15 +26,6 @@ import org.opendaylight.controller.yang.model.api.SchemaContext;
 import org.opendaylight.controller.yang.model.parser.api.YangModelParser;
 import org.opendaylight.controller.yang.parser.impl.YangParserImpl;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 public class GenEnumResolvingTest {
 
     private SchemaContext resolveSchemaContextFromFiles(
@@ -61,7 +59,7 @@ public class GenEnumResolvingTest {
         assertTrue(genTypes != null);
 
         assertEquals("Expected count of all Generated Types from yang models " +
-                "is 22", 22, genTypes.size());
+                "is 22", 25, genTypes.size());
 
         GeneratedType genInterface = null;
         for (final Type type : genTypes) {
@@ -76,7 +74,7 @@ public class GenEnumResolvingTest {
 
         Enumeration linkUpDownTrapEnable = null;
         Enumeration operStatus = null;
-        final List<Enumeration> enums = genInterface.getEnumDefintions();
+        final List<Enumeration> enums = genInterface.getEnumerations();
         assertNotNull("Generated Type Interface cannot contain NULL reference" +
                 " to Enumeration types!", enums);
         assertEquals("Generated Type Interface MUST contain 2 Enumeration " +
@@ -108,8 +106,8 @@ public class GenEnumResolvingTest {
         assertNotNull("Generated Interface cannot contain NULL reference for " +
                 "Method Signature Definitions!", methods);
 
-        assertEquals("Expected count of method signature definitions is 26",
-                26, methods.size());
+        assertEquals("Expected count of method signature definitions is 21",
+                21, methods.size());
         Enumeration ianaIfType = null;
         for (final MethodSignature method : methods) {
             if (method.getName().equals("getType")) {
@@ -135,7 +133,7 @@ public class GenEnumResolvingTest {
         final BindingGenerator bindingGen = new BindingGeneratorImpl();
         final List<Type> genTypes = bindingGen.generateTypes(context);
         assertTrue(genTypes != null);
-        assertEquals(2, genTypes.size());
+        assertEquals(3, genTypes.size());
 
         final Type type = genTypes.get(1);
         assertTrue(type instanceof Enumeration);
@@ -186,8 +184,8 @@ public class GenEnumResolvingTest {
         final List<MethodSignature> methods = genInterface.getMethodDefinitions();
         assertNotNull("Generated Type Interface cannot contain NULL reference" +
                 " to Enumeration types!", methods);
-        assertEquals("Generated Type Interface MUST contain 7 Methods ",
-                7, methods.size());
+        assertEquals("Generated Type Interface MUST contain 4 Methods ",
+                4, methods.size());
         for (final MethodSignature method : methods) {
             if (method.getName().equals("getLinkUpDownTrapEnable")) {
                 linkUpDownTrapEnable = method.getReturnType();