Refactored parsing of YANG uses statement.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / test / resources / model / testfile2.yang
index d75fc6329679b65224aca76be6cd7b3db1931e11..b25f65e4a45705d1ff6326987303cc2bf562c3b8 100644 (file)
@@ -11,7 +11,7 @@ module types2 {
     revision "2013-02-27" {
         reference " WILL BE DEFINED LATER";
     }
-    
+
     typedef my-base-int32-type {
         type int32 {
             range "2..20";
@@ -25,17 +25,17 @@ module types2 {
         units "mile";
         default "11";
     }
-    
+
     typedef my-custom-string {
         type string {
             pattern "[a-k]*";
             length "5..11";
         }
     }
-    
+
     typedef my-string-type {
         type my-custom-string {
-            length "5..10";
+            length "6..10";
         }
     }
     
@@ -56,25 +56,25 @@ module types2 {
             range "10..20";
         }
     }
-    
+
     typedef my-int-type2 {
         type my-int-type {
             range "12..18";
         }
     }
-    
+
     typedef my-int-type-ext {
         type my-int-type2 {
             range "14..16";
         }
     }
-    
+
     typedef my-decimal-type {
         type decimal64 {
             fraction-digits 6;
         }
     }
-    
+
     typedef my-decimal-type-ext {
         type decimal64 {
             fraction-digits 5;
@@ -82,27 +82,27 @@ module types2 {
     }
 
     typedef my-union {
-       type union {
-               type int16 {
-                       range "1..100";
-               }
-               type int32;
-       }
+        type union {
+            type int16 {
+                range "1..100";
+            }
+            type int32;
+        }
     }
 
     typedef my-union-ext {
-       type my-union;
+        type my-union;
     }
 
     typedef nested-union1 {
-       type nested-union2;
+        type nested-union2;
     }
 
     typedef nested-union2 {
-       type union {
-               type my-union-ext;
-               type string;
-       }
+        type union {
+            type my-union-ext;
+            type string;
+        }
     }
 
     leaf if-name {
@@ -110,15 +110,21 @@ module types2 {
             path "/interface/name";
         }
     }
-     
+
     leaf name {
         type string;
     }
-     
+
+    leaf count {
+        type int8 {
+            range "1..10";
+        }
+    }
+
     leaf nested-type-leaf {
         type my-type1;
     }
-    
+
     extension c-define {
         description
         "Takes as argument a name string.
@@ -128,13 +134,13 @@ module types2 {
             yin-element "true";
         }
     }
-    
+
     container system {
         leaf user {
             type string;
         }
     }
-    
+
     grouping target {
         anyxml data {
             config true;
@@ -188,6 +194,8 @@ module types2 {
         typedef group-type {
             type my-decimal-type;
         }
+
+        opendaylight;
     }
 
     container peer {
@@ -195,7 +203,7 @@ module types2 {
             uses target {
                 refine address {
                     default "1.2.3.4";
-                    description "description of address defined by refine";
+                    description "IP address of target node";
                     reference "address reference added by refine";
                     config false;
                     mandatory true;
@@ -205,10 +213,6 @@ module types2 {
                     }
                 }
                 refine port {
-                    must "must-condition" {
-                        error-message "An error message test";
-                        error-app-tag "An error app tag test";
-                    }
                     description "description of port defined by refine";
                     reference "port reference added by refine";
                     config false;
@@ -231,7 +235,7 @@ module types2 {
             }
         }
     }
-    
+
     container interfaces {
          list ifEntry {
              key "ifIndex";
@@ -240,11 +244,11 @@ module types2 {
                  type uint32;
                  units minutes;
              }
-             
+
              leaf ifMtu {
                  type int32;
              }
-             
+
              min-elements 1;
              max-elements 11;
          }