4ad6e786259c47e91d38fc490ef6c767dfcf4634
[yangtools.git] / yang / yang-data-impl / src / test / resources / org / opendaylight / yangtools / yang / data / impl / schema / test.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module test {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:test";
5     prefix "test";
6
7     organization "Cisco Systems, Inc.";
8
9     revision "2013-2-21" {
10         description
11             "Initial revision";
12     }
13
14     grouping listGroup {
15         list list {
16             key "uint32InList";
17
18             leaf uint32InList {
19                 type uint32;
20             }
21
22             container containerInList{
23                 leaf uint32 {
24                     type uint32;
25                 }
26                 leaf uint16 {
27                     type uint16;
28                 }
29             }
30         }
31      }
32
33      grouping innerContainerGrouping {
34         container innerContainer {
35             leaf uint16 {
36                 type uint16;
37             }
38
39             container innerInnerContainer {
40
41                 leaf uint16 {
42                     type uint16;
43                 }
44
45                 leaf uint32 {
46                     type uint32;
47                 }
48             }
49         }
50      }
51
52     container container {
53         leaf uint32 {
54             type uint32;
55         }
56
57         leaf decimal64 {
58             type decimal64 {
59                 fraction-digits 2;
60             }
61         }
62
63         leaf boolean {
64             type boolean;
65         }
66
67         leaf binary {
68             type binary;
69         }
70
71         leaf string {
72             type string;
73         }
74
75         uses listGroup;
76         uses innerContainerGrouping;
77
78         choice choice{}
79         choice choice2{}
80
81         leaf-list leafList {
82             type string;
83         }
84
85         leaf identityRef {
86             type identityref {
87                 base test-identity;
88             }
89         }
90
91         /* TODO test modification with empty type
92         leaf empty {
93              type empty;
94          }
95          */
96     }
97
98     augment "/container/" {
99         leaf augmentUint32 {
100             type uint32;
101         }
102     }
103
104     augment "/container/choice/" {
105         case test-identity-augment {
106             when "/container/identityRef = 'test-identity'";
107             leaf augmentString1 {
108                 type string;
109             }
110
111             leaf augmentInt1 {
112                 type uint32;
113             }
114         }
115         case test-identity-augment2 {
116             when "/container/identityRef = 'test-identity2'";
117             leaf augmentString2 {
118                 type string;
119             }
120
121             leaf augmentInt2 {
122                 type uint32;
123             }
124         }
125     }
126
127     augment "/container/choice2/" {
128         case test-identity-augment {
129             when "/container/identityRef = 'test-identity'";
130             container augmentContainer {
131                 leaf augmentStringInaugmentContainer {
132                     type string;
133                 }
134             }
135         }
136         case test-identity-augment2 {
137             when "/container/identityRef = 'test-identity2'";
138             list augmentedList {
139                 leaf augmentStringInaugmentList {
140                     type string;
141                 }
142             }
143         }
144     }
145
146
147     identity test-identity {}
148     identity test-identity2 {
149         base test-identity;
150     }
151
152 }