[ONOS-4616] grouping linker issues fixed and other defect fixed.

Change-Id: I1b23f9ed0293edbc2d551efe82982559eb916ede
diff --git a/utils/yangutils/src/test/resources/BitTypedefStatement.yang b/utils/yangutils/src/test/resources/BitTypedefStatement.yang
new file mode 100644
index 0000000..d3dc26a
--- /dev/null
+++ b/utils/yangutils/src/test/resources/BitTypedefStatement.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    typedef type15 { 
+        type bits {
+             bit disable-nagle {
+                 position 0;
+             }
+             bit auto-sense-speed {
+                 position 1;
+             }
+             bit Mb-only {
+                 position 2;
+             }
+         }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/BitUnionStatement.yang b/utils/yangutils/src/test/resources/BitUnionStatement.yang
new file mode 100644
index 0000000..dd62eae
--- /dev/null
+++ b/utils/yangutils/src/test/resources/BitUnionStatement.yang
@@ -0,0 +1,20 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf type15 { 
+        type union {
+            type bits {
+                bit disable-nagle {
+                    position 0;
+                }
+                bit auto-sense-speed {
+                    position 1;
+                }
+                bit Mb-only {
+                    position 2;
+                }
+            }
+        }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/EnumSorted.yang b/utils/yangutils/src/test/resources/EnumSorted.yang
new file mode 100644
index 0000000..3760e83
--- /dev/null
+++ b/utils/yangutils/src/test/resources/EnumSorted.yang
@@ -0,0 +1,18 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf ifType {
+        type enumeration {
+             enum four{
+                 value 7;
+             }
+             enum seven {
+                 value 2147483647;
+             }
+             enum five {
+                 value 5;
+             }       
+         }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/IdentityrefInvalidIdentifier.yang b/utils/yangutils/src/test/resources/IdentityrefInvalidIdentifier.yang
new file mode 100644
index 0000000..99a8129
--- /dev/null
+++ b/utils/yangutils/src/test/resources/IdentityrefInvalidIdentifier.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    grouping currentcheck {
+        leaf invalid-interval {
+            type identityref {
+            }
+        }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/InValidIdentifierXML.yang b/utils/yangutils/src/test/resources/InValidIdentifierXML.yang
new file mode 100644
index 0000000..c6a5a42
--- /dev/null
+++ b/utils/yangutils/src/test/resources/InValidIdentifierXML.yang
@@ -0,0 +1,5 @@
+module xMlTest {
+yang-version 1;
+namespace urn:ietf:params:xml:ns:yang:ietf-ospf;
+prefix On;
+}
diff --git a/utils/yangutils/src/test/resources/InstanceIdentifierInvalidIdentifier.yang b/utils/yangutils/src/test/resources/InstanceIdentifierInvalidIdentifier.yang
new file mode 100644
index 0000000..0bbe2f1
--- /dev/null
+++ b/utils/yangutils/src/test/resources/InstanceIdentifierInvalidIdentifier.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container currentcheck {
+        leaf invalid-interval {
+            type instance-identifier;
+        }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/LeafrefInvalidIdentifier.yang b/utils/yangutils/src/test/resources/LeafrefInvalidIdentifier.yang
new file mode 100644
index 0000000..4737b6c
--- /dev/null
+++ b/utils/yangutils/src/test/resources/LeafrefInvalidIdentifier.yang
@@ -0,0 +1,8 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type leafref;
+    }
+}
diff --git a/utils/yangutils/src/test/resources/LengthStatementWithSpace.yang b/utils/yangutils/src/test/resources/LengthStatementWithSpace.yang
new file mode 100644
index 0000000..e8612d1
--- /dev/null
+++ b/utils/yangutils/src/test/resources/LengthStatementWithSpace.yang
@@ -0,0 +1,10 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type string {
+            length "                                               0                                                                                      ..                                                                                                                                                                      100                                                                                         ";
+         }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/MaxElementsMaxValue.yang b/utils/yangutils/src/test/resources/MaxElementsMaxValue.yang
new file mode 100644
index 0000000..7bdfbb0
--- /dev/null
+++ b/utils/yangutils/src/test/resources/MaxElementsMaxValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        max-elements 77777777777777777777777;
+    }
+}
diff --git a/utils/yangutils/src/test/resources/MinElementsMaxValue.yang b/utils/yangutils/src/test/resources/MinElementsMaxValue.yang
new file mode 100644
index 0000000..785482b
--- /dev/null
+++ b/utils/yangutils/src/test/resources/MinElementsMaxValue.yang
@@ -0,0 +1,9 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf-list invalid-interval {
+        type "uint16";
+        min-elements 77777777777777777777777;
+    }
+}
diff --git a/utils/yangutils/src/test/resources/PositionImplicitAndExplicit.yang b/utils/yangutils/src/test/resources/PositionImplicitAndExplicit.yang
index 5be4cbb..bef9712 100644
--- a/utils/yangutils/src/test/resources/PositionImplicitAndExplicit.yang
+++ b/utils/yangutils/src/test/resources/PositionImplicitAndExplicit.yang
@@ -2,14 +2,14 @@
     yang-version 1;
     namespace http://huawei.com;
     prefix Ant;
-     leaf mybits {
-         type bits {
-             bit disable-nagle;
-             bit auto-sense-speed {
-                 position 1;
-             }
-             bit Ten-Mb-only;
-             }
-         }
+    leaf mybits {
+        type bits {
+            bit disable-nagle;
+            bit auto-sense-speed {
+                position 1;
+            }
+            bit Ten-Mb-only;
+        }
     }
 }
+
diff --git a/utils/yangutils/src/test/resources/PositionStatement.yang b/utils/yangutils/src/test/resources/PositionStatement.yang
index 76c204d..afa0a4c 100644
--- a/utils/yangutils/src/test/resources/PositionStatement.yang
+++ b/utils/yangutils/src/test/resources/PositionStatement.yang
@@ -2,17 +2,17 @@
     yang-version 1;
     namespace http://huawei.com;
     prefix Ant;
-     leaf mybits {
-         type bits {
-             bit disable-nagle {
-                 position 0;
-             }
-             bit auto-sense-speed {
-                 position 1;
-             }
-             bit Ten-Mb-only {
-                 position 2;
-             }
-         }
+    leaf mybits {
+        type bits {
+            bit disable-nagle {
+                position 0;
+            }
+            bit auto-sense-speed {
+                position 1;
+            }
+            bit Ten-Mb-only {
+                position 2;
+            }
+        }
     }
 }
diff --git a/utils/yangutils/src/test/resources/ProcessFileWithExtraBrace.yang b/utils/yangutils/src/test/resources/ProcessFileWithExtraBrace.yang
new file mode 100644
index 0000000..ca3f0d0
--- /dev/null
+++ b/utils/yangutils/src/test/resources/ProcessFileWithExtraBrace.yang
@@ -0,0 +1,15 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+        container food {
+            choice snack {
+                list sports-arena {
+                }
+            }
+        }
+    }
+}
+}
+}
+}
diff --git a/utils/yangutils/src/test/resources/ProcessFileWithExtraBraceInBetween.yang b/utils/yangutils/src/test/resources/ProcessFileWithExtraBraceInBetween.yang
new file mode 100644
index 0000000..580d270
--- /dev/null
+++ b/utils/yangutils/src/test/resources/ProcessFileWithExtraBraceInBetween.yang
@@ -0,0 +1,35 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    import ietf-yang-types {
+        prefix "P";
+    }
+    grouping Percentage {
+        leaf hello{
+            type string;
+        }
+        leaf invalid1{
+            type string;
+        }
+        }
+        leaf invalid2{
+            type string;
+        }
+    }
+    container ospf {
+        list valid {
+            key "invalid";
+            leaf invalid{
+                type string;
+            }
+            uses Ant:FirstClass;
+            grouping FirstClass {
+                uses P:PassingClass;
+            }
+        }
+        grouping PassingClass {
+            uses Ant:Percentage;
+        }
+    }
+}
diff --git a/utils/yangutils/src/test/resources/ProcessFileWithExtraLeaf.yang b/utils/yangutils/src/test/resources/ProcessFileWithExtraLeaf.yang
new file mode 100644
index 0000000..5624b7a
--- /dev/null
+++ b/utils/yangutils/src/test/resources/ProcessFileWithExtraLeaf.yang
@@ -0,0 +1,13 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    container food {
+        choice snack {
+            list sports-arena {
+            }
+        }
+    }
+}
+leaf invalid {
+
diff --git a/utils/yangutils/src/test/resources/RangeStatementWithSpace.yang b/utils/yangutils/src/test/resources/RangeStatementWithSpace.yang
new file mode 100644
index 0000000..a41d68a
--- /dev/null
+++ b/utils/yangutils/src/test/resources/RangeStatementWithSpace.yang
@@ -0,0 +1,11 @@
+module Test {
+    yang-version 1;
+    namespace http://huawei.com;
+    prefix Ant;
+    leaf invalid-interval {
+        type int32 {
+            range "                          1                        ..                                        4 |                        10               ..                                          20                  ";
+         }
+    }
+}
+
diff --git a/utils/yangutils/src/test/resources/ShortCaseListenerWithContainer.yang b/utils/yangutils/src/test/resources/ShortCaseListenerWithContainer.yang
index 166eeb0..3322a66 100644
--- a/utils/yangutils/src/test/resources/ShortCaseListenerWithContainer.yang
+++ b/utils/yangutils/src/test/resources/ShortCaseListenerWithContainer.yang
@@ -2,12 +2,11 @@
     yang-version 1;
     namespace http://huawei.com;
     prefix Ant;
-        container food {
-            choice snack {
-                container sports-arena {
-                    leaf pretzel {
-                        type empty;
-                    }
+    container food {
+        choice snack {
+            container sports-arena {
+                leaf pretzel {
+                    type empty;
                 }
             }
         }
diff --git a/utils/yangutils/src/test/resources/ShortCaseListenerWithList.yang b/utils/yangutils/src/test/resources/ShortCaseListenerWithList.yang
index eb03fca..6eeec79 100644
--- a/utils/yangutils/src/test/resources/ShortCaseListenerWithList.yang
+++ b/utils/yangutils/src/test/resources/ShortCaseListenerWithList.yang
@@ -2,15 +2,15 @@
     yang-version 1;
     namespace http://huawei.com;
     prefix Ant;
-        container food {
-            choice snack {
-                list sports-arena {
-                    key "pretzel";
-                    leaf pretzel {
-                        type int32;
-                    }
+    container food {
+        choice snack {
+            list sports-arena {
+                key "pretzel";
+                leaf pretzel {
+                    type int32;
                 }
             }
         }
     }
 }
+
diff --git a/utils/yangutils/src/test/resources/ValidNotificationStatement.yang b/utils/yangutils/src/test/resources/ValidNotificationStatement.yang
index 7e6bc17..1e0f144 100644
--- a/utils/yangutils/src/test/resources/ValidNotificationStatement.yang
+++ b/utils/yangutils/src/test/resources/ValidNotificationStatement.yang
@@ -14,7 +14,7 @@
            type int32;
         }
         leaf if-name {
-           type leafref;
+           type string;
         }
         leaf if-admin-status {
            type P:admin-status;