Bug 1512 - generated builder java file for a leaf containing a union
[yangtools.git] / code-generator / binding-java-api-generator / src / test / resources / compilation / typedef / foo.yang
index 7a43a64458fc0f1d6a47317de4ba1f7cef5a5af0..855279f3fc3e5f0e04e5fbcd50b4b995da9b88f8 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 module foo {
     yang-version 1;
     namespace "urn:opendaylight.foo";
@@ -6,9 +13,51 @@ module foo {
     revision "2013-10-08" {
     }
 
+
+    typedef bits-ext {
+        type bits {
+            bit pc {
+                position 0;
+            }
+            bit bpc {
+                position 1;
+            }
+            bit dpc {
+                position 2;
+            }
+            bit lbpc {
+                position 3;
+            }
+            bit spc {
+                position 4;
+            }
+            bit sfmof {
+                position 5;
+            }
+            bit sfapc {
+                position 6;
+            }
+        }
+    }
+
+    typedef myenum {
+        type enumeration {
+            enum zero;
+            enum one;
+            enum seven {
+                value 7;
+            }
+        }
+        default one;
+    }
+
+    typedef int32-ext0 {
+        type int32;
+    }
+
     typedef int32-ext1 {
         type int32 {
-            range "2..20";
+            range "2..2147483647";
         }
     }
 
@@ -42,6 +91,14 @@ module foo {
     typedef my-decimal-type {
         type decimal64 {
             fraction-digits 6;
+            range "1.5..5.5";
+        }
+    }
+
+    typedef my-decimal-type2 {
+        type decimal64 {
+            fraction-digits 18;
+            range "0..1";
         }
     }
 
@@ -63,6 +120,7 @@ module foo {
             type union-ext2;
             type string;
         }
+        units "object id";
     }
 
     typedef union-ext4 {
@@ -94,4 +152,44 @@ module foo {
         }
     }
 
+
+    typedef a {
+        type int8;
+    }
+
+    typedef b {
+        type int16;
+    }
+
+    typedef c {
+        type int32;
+    }
+
+    typedef d {
+        type int64 {
+            range 0..max;
+        }
+    }
+
+    typedef e {
+        type uint8;
+    }
+
+    typedef f {
+        type uint16;
+    }
+
+    typedef g {
+        type uint32;
+    }
+
+    typedef h {
+        type uint64;
+    }
+    container cont1 {
+        leaf leaf1 {
+            type union-ext1;
+        }
+    }
+
 }