YAB and YOB defect fix

Change-Id: Ifed54236cfa83b4754383467818581bec59191d9
diff --git a/apps/yms/ut/src/test/resources/ydtTestYangFiles/binarytest.yang b/apps/yms/ut/src/test/resources/ydtTestYangFiles/binarytest.yang
index 71ada48..f6db459d 100644
--- a/apps/yms/ut/src/test/resources/ydtTestYangFiles/binarytest.yang
+++ b/apps/yms/ut/src/test/resources/ydtTestYangFiles/binarytest.yang
@@ -30,4 +30,45 @@
               }
         }
     }
+
+    typedef percent {
+        type binary;
+    }
+
+    leaf name {
+        type percent;
+    }
+
+    grouping greeting {
+        leaf surname {
+            type binary;
+        }
+    }
+
+    container cont1 {
+        uses greeting;
+    }
+
+    augment "/cont1" {
+        leaf lastname {
+            type binary;
+        }
+    }
+
+    container food {
+        choice snack {
+            case sportsarena {
+                leaf pretzel {
+                    type binary;
+                }
+            }
+        }
+    }
+
+    leaf middlename {
+        type union {
+            type int8;
+            type binary;
+        }
+    }
 }
\ No newline at end of file
diff --git a/apps/yms/ut/src/test/resources/ydtTestYangFiles/bit.yang b/apps/yms/ut/src/test/resources/ydtTestYangFiles/bit.yang
index 6d97ccc..8b4f0c3 100644
--- a/apps/yms/ut/src/test/resources/ydtTestYangFiles/bit.yang
+++ b/apps/yms/ut/src/test/resources/ydtTestYangFiles/bit.yang
@@ -13,22 +13,6 @@
     revision "2016-05-24" {
         description "Initial revision.";
     }
-/*
-     leaf mybits {
-         type bits {
-             bit disable-nagle {
-                 position 0;
-             }
-             bit auto-sense-speed {
-                 position 1;
-             }
-             bit 10-Mb-only {
-                 position 2;
-             }
-         }
-         default "auto-sense-speed";
-     }
-     */
 
     list bitList {
         config false;
@@ -44,8 +28,80 @@
                 position 2;
                 }
             }
-            default "auto-sense-speed";
+        }
+    }
 
+    typedef percent {
+        type bits {
+            bit bit3 {
+                position 3;
+            }
+            bit bit4 {
+                position 4;
+            }
+            bit bit5 {
+                position 5;
+            }
+        }
+    }
+
+    leaf name {
+        type percent;
+    }
+
+    grouping greeting {
+        leaf surname {
+            type bits {
+                bit bit6 {
+                    position 6;
+                }
+                bit bit7 {
+                    position 7;
+                }
+                bit bit8 {
+                    position 8;
+                }
+            }
+        }
+    }
+
+    container cont1 {
+        uses greeting;
+    }
+
+    augment "/cont1" {
+        leaf lastname {
+            type bits {
+                bit bit9 {
+                    position 9;
+                }
+                bit bit10 {
+                    position 10;
+                }
+                bit bit11 {
+                    position 11;
+                }
+            }
+        }
+    }
+
+    container food {
+        choice snack {
+           case sportsarena {
+               leaf pretzel {
+                   type bits {
+                       bit bit12 {
+                          position 12;
+                       }
+                       bit bit13 {
+                          position 13;
+                       }
+                       bit bit14 {
+                          position 14;
+                       }
+                   }
+               }
+           }
         }
     }
 }
\ No newline at end of file
diff --git a/apps/yms/ut/src/test/resources/ydtTestYangFiles/leafreftest.yang b/apps/yms/ut/src/test/resources/ydtTestYangFiles/leafreftest.yang
new file mode 100644
index 0000000..5191b72
--- /dev/null
+++ b/apps/yms/ut/src/test/resources/ydtTestYangFiles/leafreftest.yang
@@ -0,0 +1,71 @@
+module leafreftest {
+
+    yang-version 1;
+
+    namespace "ydt.leafreftest";
+
+    prefix "uniontest";
+
+    organization "ON-LAB";
+
+    description "This module defines for union classifier.";
+
+    revision "2016-05-24" {
+        description "Initial revision.";
+    }
+
+    leaf middlename  {
+        type string;
+    }
+
+    list leafrefList {
+        config false;
+        leaf id {
+            type leafref {
+                path "/middlename";
+            }
+        }
+    }
+
+    typedef percent {
+        type leafref {
+            path "/middlename";
+        }
+    }
+
+    leaf name {
+        type percent;
+    }
+
+    grouping greeting {
+        leaf surname {
+            type leafref {
+                path "/middlename";
+            }
+        }
+    }
+
+    container cont1 {
+        uses greeting;
+    }
+
+    augment "/cont1" {
+        leaf lastname {
+            type leafref {
+                path "/middlename";
+            }
+        }
+    }
+
+    container food {
+        choice snack {
+            case sportsarena {
+                leaf pretzel {
+                    type leafref {
+                        path "/middlename";
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/apps/yms/ut/src/test/resources/ydtTestYangFiles/uniontest.yang b/apps/yms/ut/src/test/resources/ydtTestYangFiles/uniontest.yang
new file mode 100644
index 0000000..4ab5801
--- /dev/null
+++ b/apps/yms/ut/src/test/resources/ydtTestYangFiles/uniontest.yang
@@ -0,0 +1,92 @@
+module uniontest {
+
+    yang-version 1;
+
+    namespace "ydt.uniontest";
+
+    prefix "uniontest";
+
+    organization "ON-LAB";
+
+    description "This module defines for union classifier.";
+
+    revision "2016-05-24" {
+        description "Initial revision.";
+    }
+
+    list unionList {
+        config false;
+        leaf id {
+            type union {
+                type int8;
+                type binary;
+            }
+        }
+    }
+
+    typedef percent {
+        type union {
+            type int8;
+            type bits {
+                bit bit0 {
+                    position 0;
+                }
+                bit bit1 {
+                    position 1;
+                }
+                bit bit2 {
+                    position 2;
+                }
+            }
+        }
+    }
+
+    leaf name {
+        type percent;
+    }
+
+    grouping greeting {
+        leaf surname {
+            type union {
+                type int8;
+                type string;
+            }
+        }
+    }
+
+    container cont1 {
+        uses greeting;
+    }
+
+    augment "/cont1" {
+        leaf lastname {
+            type union {
+                type int8;
+                type bits {
+                    bit bit0 {
+                        position 0;
+                    }
+                    bit bit1 {
+                        position 1;
+                    }
+                    bit bit2 {
+                        position 2;
+                    }
+                }
+            }
+        }
+    }
+
+    container food {
+        choice snack {
+            case sportsarena {
+                leaf pretzel {
+                    type union {
+                        type int8;
+                        type binary;
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file