Bug 4969: NPE in JSONCodecFactory by attempt to find codec for a leafref
[yangtools.git] / yang / yang-data-codec-gson / src / test / resources / bug-4969 / yang / bar.yang
diff --git a/yang/yang-data-codec-gson/src/test/resources/bug-4969/yang/bar.yang b/yang/yang-data-codec-gson/src/test/resources/bug-4969/yang/bar.yang
new file mode 100644 (file)
index 0000000..b594d3d
--- /dev/null
@@ -0,0 +1,59 @@
+module bar {
+    namespace "bar";
+    prefix bar;
+
+    revision "2016-01-22" {
+        description "Initial version";
+    }
+
+    typedef ref1 {
+        type ref1-2;
+    }
+
+    typedef ref2 {
+        type ref2-2;
+    }
+
+    typedef ref3 {
+        type ref3-2;
+    }
+
+    typedef ref1-2 {
+        type leafref {
+            path "/root/l1";
+        }
+    }
+
+    typedef ref2-2 {
+        type leafref {
+            path "/root/l2";
+        }
+    }
+
+    typedef ref3-2 {
+        type leafref {
+            path "/root/l3";
+        }
+    }
+
+    container root {
+        leaf l1 {
+            type bits {
+                bit a;
+                bit b;
+                bit c;
+                bit d;
+            }
+        }
+        leaf l2 {
+            type leafref {
+                path "/root/l1";
+            }
+        }
+        leaf l3 {
+            type leafref {
+                path "../l1";
+            }
+        }
+    }
+}