Improve ImmutableAugmentationNodeBuilder defensiveness
[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 "2014-03-13" {
10         description
11             "Initial revision";
12     }
13
14     identity a {}
15
16     identity b {
17         base "test:a";
18     }
19
20     grouping listGroup {
21         list list {
22             key "uint32InList";
23
24             leaf uint32InList {
25                 type uint32;
26             }
27
28             container containerInList{
29                 leaf uint32 {
30                     type uint32;
31                 }
32                 leaf uint16 {
33                     type uint16;
34                 }
35
36                 leaf identityr {
37                     type identityref {
38                         base "test:a";
39                      }
40                 }
41
42                 leaf uint16-ref {
43                     type leafref {
44                         path "../uint16";
45                      }
46                 }
47
48                 leaf instance-id {
49                     type instance-identifier;
50                 }
51
52                 anyxml anyX;
53             }
54         }
55      }
56
57      grouping innerContainerGrouping {
58         container innerContainer {
59             leaf uint16 {
60                 type uint16;
61             }
62
63             container innerInnerContainer {
64
65                 leaf uint16 {
66                     type uint16;
67                 }
68
69                 leaf uint32 {
70                     type uint32;
71                 }
72             }
73         }
74      }
75
76     container container {
77         leaf uint32 {
78             type uint32;
79         }
80
81         leaf decimal64 {
82             type decimal64 {
83                 fraction-digits 2;
84             }
85         }
86
87         leaf boolean {
88             type boolean;
89         }
90
91         leaf binary {
92             type binary;
93         }
94
95         leaf string {
96             type string;
97         }
98
99         uses listGroup {
100             augment "list/" {
101                 leaf stringAugmentedToList{
102                     type string;
103                 }
104
105                 choice choiceInList {
106                     case caseInList1 {
107                         leaf stringAugmentedToListInCase1 {
108                             type string;
109                         }
110                     }
111                     case caseInList2 {
112                         leaf stringAugmentedToListInCase2 {
113                             type string;
114                         }
115                     }
116                 }
117             }
118         }
119
120         list directList {
121             leaf stringInDirectList {
122                 type string;
123             }
124         }
125
126         uses innerContainerGrouping;
127
128         choice choice{}
129         choice choice2{}
130
131         leaf-list leafList {
132             type string;
133         }
134
135         leaf identityRef {
136             type identityref {
137                 base test-identity;
138             }
139         }
140
141         /* TODO test modification with empty type
142         leaf empty {
143              type empty;
144          }
145          */
146     }
147
148     augment "/container/" {
149         leaf augmentUint32 {
150             type uint32;
151         }
152     }
153
154     augment "/container/directList/" {
155         leaf augmentedString {
156             type uint32;
157         }
158     }
159
160     augment "/container/choice/" {
161         case test-identity-augment {
162             when "/container/identityRef = 'test-identity'";
163             leaf augmentString1 {
164                 type string;
165             }
166
167             leaf augmentInt1 {
168                 type uint32;
169             }
170         }
171         case test-identity-augment2 {
172             when "/container/identityRef = 'test-identity2'";
173             leaf augmentString2 {
174                 type string;
175             }
176
177             leaf augmentInt2 {
178                 type uint32;
179             }
180         }
181     }
182
183     augment "/container/choice/test-identity-augment/" {
184
185         choice augmentedChoiceInCase {
186
187             case augmentedCaseInAugmentedChoice {
188                 leaf stringInAugmentedCaseInAugmentedChoice {
189                     type string;
190                 }
191             }
192
193             case augmentedCaseInAugmentedChoice2 {
194                 leaf stringInAugmentedCaseInAugmentedChoice2 {
195                     type string;
196                 }
197             }
198         }
199     }
200
201     augment "/container/choice/test-identity-augment/augmentedChoiceInCase/" {
202         case augmentedCaseInAugmentedChoiceFromAugment {
203             leaf stringInAugmentedCaseInAugmentedChoiceFromAugment {
204                 type string;
205             }
206         }
207     }
208
209     augment "/container/choice2/" {
210         case test-identity-augment {
211             when "/container/identityRef = 'test-identity'";
212             container augmentContainer {
213                 leaf augmentStringInaugmentContainer {
214                     type string;
215                 }
216             }
217         }
218         case test-identity-augment2 {
219             when "/container/identityRef = 'test-identity2'";
220             list augmentedList {
221                 leaf augmentStringInaugmentList {
222                     type string;
223                 }
224             }
225         }
226     }
227
228
229     augment "/container/choice2/test-identity-augment2/augmentedList/" {
230
231         container augmentedContainerInAugmentedListInAugmentedCase {
232             leaf-list leafInAugmentedContainerInAugmentedListInAugmentedCase {
233                 type uint32;
234             }
235         }
236
237         list augmentedListInAugmentedListInAugmentedCase {
238             leaf-list leafInAugmentedListInAugmentedListInAugmentedCase {
239                     type uint32;
240                 }
241         }
242     }
243
244     identity test-identity {}
245     identity test-identity2 {
246         base test-identity;
247     }
248
249 }