Merge "Simplify method isMutualExclusive in Subnet. Remove redundant 'if' statements."
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / cnsn / to / json / test / ToJsonBasicYangTypesTest.java
1 package org.opendaylight.controller.sal.restconf.impl.cnsn.to.json.test;
2
3 import static org.junit.Assert.*;
4
5 import java.io.IOException;
6 import java.io.StringReader;
7 import java.util.Map;
8 import java.util.Set;
9
10 import org.junit.Test;
11 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
12 import org.opendaylight.controller.sal.restconf.impl.test.structures.*;
13 import org.opendaylight.yangtools.yang.data.api.*;
14 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
15
16 import com.google.gson.stream.JsonReader;
17 import com.google.gson.stream.JsonToken;
18
19 public class ToJsonBasicYangTypesTest {
20
21     /**
22      * Test of json output when as input are specified composite node with empty
23      * data + YANG file
24      */
25     @Test
26     public void compositeNodeAndYangWithJsonReaderEmptyDataTest() {
27         String jsonOutput = TestUtils.convertCompositeNodeDataAndYangToJson(prepareCompositeNodeWithEmpties(),
28                 "/cnsn-to-json/simple-yang-types", "/cnsn-to-json/simple-yang-types/xml", "simple-yang-types", "cont1");
29         verifyJsonOutputForEmpty(jsonOutput);
30     }
31
32     /**
33      * Test of json output when as input are specified xml file (no empty
34      * elements)and YANG file
35      */
36     @Test
37     public void xmlAndYangTypesWithJsonReaderTest() {
38         String jsonOutput = TestUtils.convertCompositeNodeDataAndYangToJson(
39                 TestUtils.loadCompositeNode("/cnsn-to-json/simple-yang-types/xml/data.xml"),
40                 "/cnsn-to-json/simple-yang-types", "/cnsn-to-json/simple-yang-types/xml", "simple-yang-types", "cont1");
41         verifyJsonOutput(jsonOutput);
42     }
43
44     private void verifyJsonOutputForEmpty(String jsonOutput) {
45         StringReader strReader = new StringReader(jsonOutput);
46         JsonReader jReader = new JsonReader(strReader);
47
48         String exception = null;
49         Cont dataFromJson = null;
50         try {
51             dataFromJson = jsonReadCont1(jReader);
52         } catch (IOException e) {
53             exception = e.getMessage();
54         }
55
56         assertNotNull("Data structures from json are missing.", dataFromJson);
57         checkDataFromJsonEmpty(dataFromJson);
58
59         assertNull("Error during reading Json output: " + exception, exception);
60     }
61
62     private void verifyJsonOutput(String jsonOutput) {
63         StringReader strReader = new StringReader(jsonOutput);
64         JsonReader jReader = new JsonReader(strReader);
65
66         String exception = null;
67         Cont dataFromJson = null;
68         try {
69             dataFromJson = jsonReadCont1(jReader);
70         } catch (IOException e) {
71             exception = e.getMessage();
72         }
73
74         assertNotNull("Data structures from json are missing.", dataFromJson);
75         checkDataFromJson(dataFromJson);
76
77         assertNull("Error during reading Json output: " + exception, exception);
78     }
79
80     private Cont jsonReadCont1(JsonReader jReader) throws IOException {
81         jReader.beginObject();
82         assertNotNull("cont1 is missing.", jReader.hasNext());
83
84         Cont dataFromJson = new Cont(jReader.nextName());
85         dataFromJson = jsonReadCont1Elements(jReader, dataFromJson);
86
87         assertFalse("cont shouldn't have other element.", jReader.hasNext());
88         jReader.endObject();
89         return dataFromJson;
90
91     }
92
93     private Cont jsonReadCont1Elements(JsonReader jReader, Cont redData) throws IOException {
94         jReader.beginObject();
95         while (jReader.hasNext()) {
96             String keyName = jReader.nextName();
97             if (keyName.equals("lf11")) {
98                 redData.addLf(new Lf(keyName, nextValue(jReader)));
99             } else if (keyName.equals("lflst11")) {
100                 LfLst lfLst = new LfLst(keyName);
101                 lfLst = jsonReadLflstValues(jReader, lfLst);
102                 redData.addLfLst(lfLst);
103             } else if (keyName.equals("lflst12")) {
104                 LfLst lfLst = new LfLst(keyName);
105                 jsonReadLflstValues(jReader, lfLst);
106                 redData.addLfLst(lfLst);
107             } else if (keyName.equals("lst11")) {
108                 Lst lst = new Lst(keyName);
109                 lst = jsonReadLst11(jReader, lst);
110                 redData.addLst(lst);
111             } else {
112                 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
113             }
114         }
115         jReader.endObject();
116         return redData;
117
118     }
119
120     private Lst jsonReadLst11(JsonReader jReader, Lst lst) throws IOException {
121         jReader.beginArray();
122
123         while (jReader.hasNext()) {
124             LstItem lstItem = jsonReadLst11Elements(jReader);
125             lst.addLstItem(lstItem);
126         }
127         jReader.endArray();
128         return lst;
129     }
130
131     private LstItem jsonReadLst11Elements(JsonReader jReader) throws IOException {
132         LstItem lstItem = new LstItem();
133         jReader.beginObject();
134         while (jReader.hasNext()) {
135             String keyName = jReader.nextName();
136             if (keyName.equals("lf111")) {
137                 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
138             } else if (keyName.equals("lf112")) {
139                 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
140             } else if (keyName.equals("cont111")) {
141                 Cont cont = new Cont(keyName);
142                 cont = jsonReadCont111(jReader, cont);
143                 lstItem.addCont(cont);
144             } else if (keyName.equals("lst111")) {
145                 Lst lst = new Lst(keyName);
146                 lst = jsonReadLst111(jReader, lst);
147                 lstItem.addLst(lst);
148             } else if (keyName.equals("lst112")) {
149                 Lst lst = new Lst(keyName);
150                 lst = jsonReadLst112(jReader, lst);
151                 lstItem.addLst(lst);
152             } else {
153                 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
154             }
155         }
156         jReader.endObject();
157         return lstItem;
158     }
159
160     private Lst jsonReadLst112(JsonReader jReader, Lst lst) throws IOException {
161         jReader.beginArray();
162         while (jReader.hasNext()) {
163             LstItem lstItem = jsonReadLst112Elements(jReader);
164             lst.addLstItem(lstItem);
165         }
166         jReader.endArray();
167         return lst;
168     }
169
170     private LstItem jsonReadLst112Elements(JsonReader jReader) throws IOException {
171         LstItem lstItem = new LstItem();
172         jReader.beginObject();
173         if (jReader.hasNext()) {
174             String keyName = jReader.nextName();
175             if (keyName.equals("lf1121")) {
176                 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
177             }
178         }
179         jReader.endObject();
180         return lstItem;
181
182     }
183
184     private Lst jsonReadLst111(JsonReader jReader, Lst lst) throws IOException {
185         jReader.beginArray();
186         while (jReader.hasNext()) {
187             LstItem lstItem = jsonReadLst111Elements(jReader);
188             lst.addLstItem(lstItem);
189         }
190         jReader.endArray();
191         return lst;
192     }
193
194     private LstItem jsonReadLst111Elements(JsonReader jReader) throws IOException {
195         LstItem lstItem = new LstItem();
196         jReader.beginObject();
197         if (jReader.hasNext()) {
198             String keyName = jReader.nextName();
199             if (keyName.equals("lf1111")) {
200                 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
201             }
202         }
203         jReader.endObject();
204         return lstItem;
205     }
206
207     private Object nextValue(JsonReader jReader) throws IOException {
208         if (jReader.peek().equals(JsonToken.NULL)) {
209             jReader.nextNull();
210             return null;
211         } else if (jReader.peek().equals(JsonToken.NUMBER)) {
212             return jReader.nextInt();
213         } else {
214             return jReader.nextString();
215         }
216     }
217
218     private Cont jsonReadCont111(JsonReader jReader, Cont cont) throws IOException {
219         jReader.beginObject();
220         cont = jsonReadCont111Elements(jReader, cont);
221         jReader.endObject();
222         return cont;
223     }
224
225     private Cont jsonReadCont111Elements(JsonReader jReader, Cont cont) throws IOException {
226         while (jReader.hasNext()) {
227             String keyName = jReader.nextName();
228             if (keyName.equals("lf1111")) {
229                 cont.addLf(new Lf(keyName, nextValue(jReader)));
230             } else if (keyName.equals("lflst1111")) {
231                 LfLst lfLst = new LfLst(keyName);
232                 lfLst = jsonReadLflstValues(jReader, lfLst);
233                 cont.addLfLst(lfLst);
234             } else if (keyName.equals("lst1111")) {
235                 Lst lst = new Lst(keyName);
236                 lst = jsonReadLst1111(jReader, lst);
237                 cont.addLst(lst);
238             } else {
239                 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
240             }
241         }
242         return cont;
243
244     }
245
246     private Lst jsonReadLst1111(JsonReader jReader, Lst lst) throws IOException {
247         jReader.beginArray();
248         while (jReader.hasNext()) {
249             LstItem lstItem = jsonReadLst1111Elements(jReader);
250             lst.addLstItem(lstItem);
251         }
252         jReader.endArray();
253         return lst;
254     }
255
256     private LstItem jsonReadLst1111Elements(JsonReader jReader) throws IOException {
257         jReader.beginObject();
258         LstItem lstItem = new LstItem();
259         while (jReader.hasNext()) {
260             String keyName = jReader.nextName();
261             if (keyName.equals("lf1111A") || keyName.equals("lf1111B")) {
262                 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
263             }
264         }
265         jReader.endObject();
266         return lstItem;
267     }
268
269     private LfLst jsonReadLflstValues(JsonReader jReader, LfLst lfLst) throws IOException {
270         jReader.beginArray();
271         while (jReader.hasNext()) {
272             lfLst.addLf(new Lf(nextValue(jReader)));
273         }
274         jReader.endArray();
275         return lfLst;
276     }
277
278     private void checkDataFromJsonEmpty(Cont dataFromJson) {
279         assertTrue(dataFromJson.getLfs().isEmpty());
280         assertTrue(dataFromJson.getLfLsts().isEmpty());
281         assertTrue(dataFromJson.getConts().isEmpty());
282
283         Map<String, Lst> lsts = dataFromJson.getLsts();
284         assertEquals(1, lsts.size());
285         Lst lst11 = lsts.get("lst11");
286         assertNotNull(lst11);
287         Set<LstItem> lstItems = lst11.getLstItems();
288         assertNotNull(lstItems);
289
290         LstItem lst11_1 = null;
291         LstItem lst11_2 = null;
292         LstItem lst11_3 = null;
293         for (LstItem lstItem : lstItems) {
294             if (lstItem.getLfs().get("lf111").getValue().equals(1)) {
295                 lst11_1 = lstItem;
296             } else if (lstItem.getLfs().get("lf111").getValue().equals(2)) {
297                 lst11_2 = lstItem;
298             } else if (lstItem.getLfs().get("lf111").getValue().equals(3)) {
299                 lst11_3 = lstItem;
300             }
301         }
302
303         assertNotNull(lst11_1);
304         assertNotNull(lst11_2);
305         assertNotNull(lst11_3);
306
307         // lst11_1
308         assertTrue(lst11_1.getLfLsts().isEmpty());
309         assertEquals(1, lst11_1.getLfs().size());
310         assertEquals(1, lst11_1.getConts().size());
311         assertEquals(1, lst11_1.getLsts().size());
312         assertEquals(
313                 lst11_1.getLsts().get("lst111"),
314                 new Lst("lst111").addLstItem(new LstItem().addLf("lf1111", (int) 35))
315                         .addLstItem(new LstItem().addLf("lf1111", (int) 34)).addLstItem(new LstItem())
316                         .addLstItem(new LstItem()));
317         assertEquals(lst11_1.getConts().get("cont111"), new Cont("cont111"));
318         // : lst11_1
319
320         // lst11_2
321         assertTrue(lst11_2.getLfLsts().isEmpty());
322         assertEquals(1, lst11_2.getLfs().size());
323         assertEquals(1, lst11_2.getConts().size());
324         assertEquals(1, lst11_2.getLsts().size());
325
326         Cont lst11_2_cont111 = lst11_2.getConts().get("cont111");
327
328         // -cont111
329         assertNotNull(lst11_2_cont111);
330         assertTrue(lst11_2_cont111.getLfs().isEmpty());
331         assertEquals(1, lst11_2_cont111.getLfLsts().size());
332         assertEquals(1, lst11_2_cont111.getLsts().size());
333         assertTrue(lst11_2_cont111.getConts().isEmpty());
334
335         assertEquals(new LfLst("lflst1111").addLf((int) 1024).addLf((int) 4096),
336                 lst11_2_cont111.getLfLsts().get("lflst1111"));
337         assertEquals(
338                 new Lst("lst1111").addLstItem(new LstItem().addLf("lf1111B", (int) 4)).addLstItem(
339                         new LstItem().addLf("lf1111A", "lf1111A str12")), lst11_2_cont111.getLsts().get("lst1111"));
340         // :-cont111
341         assertEquals(lst11_2.getLsts().get("lst112"), new Lst("lst112").addLstItem(new LstItem()));
342         // : lst11_2
343
344         // lst11_3
345         assertEquals(1, lst11_3.getLfs().size());
346         assertTrue(lst11_3.getLfLsts().isEmpty());
347         assertTrue(lst11_3.getLsts().isEmpty());
348         assertTrue(lst11_3.getLsts().isEmpty());
349
350         // -cont111
351         Cont lst11_3_cont111 = lst11_3.getConts().get("cont111");
352         assertEquals(0, lst11_3_cont111.getLfs().size());
353         assertEquals(0, lst11_3_cont111.getLfLsts().size());
354         assertEquals(1, lst11_3_cont111.getLsts().size());
355         assertTrue(lst11_3_cont111.getConts().isEmpty());
356
357         assertEquals(new Lst("lst1111").addLstItem(new LstItem()).addLstItem(new LstItem()), lst11_3_cont111.getLsts()
358                 .get("lst1111"));
359         // :-cont111
360         // : lst11_3
361
362     }
363
364     private void checkDataFromJson(Cont dataFromJson) {
365         assertNotNull(dataFromJson.getLfs().get("lf11"));
366         assertEquals(dataFromJson.getLfs().get("lf11"), new Lf("lf11", "lf"));
367
368         LfLst lflst11 = null;
369         LfLst lflst12 = null;
370
371         lflst11 = dataFromJson.getLfLsts().get("lflst11");
372         lflst12 = dataFromJson.getLfLsts().get("lflst12");
373
374         assertNotNull(lflst11);
375         assertNotNull(lflst12);
376
377         assertEquals(3, lflst11.getLfs().size());
378         assertTrue(lflst11.getLfs().contains(new Lf(55)));
379         assertTrue(lflst11.getLfs().contains(new Lf(56)));
380         assertTrue(lflst11.getLfs().contains(new Lf(57)));
381
382         assertEquals(3, lflst12.getLfs().size());
383         assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str1")));
384         assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str2")));
385         assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str3")));
386
387         assertEquals(1, dataFromJson.getLsts().size());
388         Lst lst11 = dataFromJson.getLsts().get("lst11");
389         assertNotNull(lst11);
390         assertEquals(2, lst11.getLstItems().size());
391
392         LstItem lst11_1 = null;
393         LstItem lst11_2 = null;
394         for (LstItem lstItem : lst11.getLstItems()) {
395             Lf lf = lstItem.getLfs().get("lf111");
396             if (lf != null && lf.getValue().equals(140)) {
397                 lst11_1 = lstItem;
398             } else if (lf != null && lf.getValue().equals(141)) {
399                 lst11_2 = lstItem;
400             }
401         }
402
403         checkLst11_1(lst11_1);
404         checkLst11_2(lst11_2);
405     }
406
407     private void checkLst11_2(LstItem lst11_2) {
408         assertNotNull(lst11_2);
409         assertEquals(2, lst11_2.getLfs().size());
410         assertEquals(1, lst11_2.getConts().size());
411         assertEquals(2, lst11_2.getLsts().size());
412
413         assertEquals(lst11_2.getLfs().get("lf112"), new Lf("lf112", "lf112 str2"));
414
415         Cont lst11_2_cont = lst11_2.getConts().get("cont111");
416         assertEquals(0, lst11_2_cont.getConts().size());
417         assertEquals(1, lst11_2_cont.getLfLsts().size());
418         assertEquals(1, lst11_2_cont.getLfs().size());
419         assertEquals(1, lst11_2_cont.getLsts().size());
420
421         // cont111 check
422         assertEquals(new Lf("lf1111", "lf1111 str2"), lst11_2_cont.getLfs().get("lf1111"));
423         assertEquals(new LfLst("lflst1111").addLf(new Lf(2049)).addLf(new Lf(1025)).addLf(new Lf(4097)), lst11_2_cont
424                 .getLfLsts().get("lflst1111"));
425
426         assertNotNull(lst11_2_cont.getLsts().get("lst1111"));
427         checkLst1111(lst11_2_cont.getLsts().get("lst1111").getLstItems(), new Lf("lf1111A", "lf1111A str21"), new Lf(
428                 "lf1111B", 5), new Lf("lf1111A", "lf1111A str22"), new Lf("lf1111B", 8));
429
430         checkLst11x(lst11_2.getLsts().get("lst111"), new LstItem().addLf(new Lf("lf1111", 55)),
431                 new LstItem().addLf(new Lf("lf1111", 56)));
432         checkLst11x(lst11_2.getLsts().get("lst112"), new LstItem().addLf(new Lf("lf1121", "lf1121 str22")),
433                 new LstItem().addLf(new Lf("lf1121", "lf1121 str21")));
434     }
435
436     private void checkLst11_1(LstItem lst11_1) {
437         assertNotNull(lst11_1);
438
439         assertEquals(2, lst11_1.getLfs().size());
440         assertEquals(1, lst11_1.getConts().size());
441         assertEquals(2, lst11_1.getLsts().size());
442
443         assertEquals(lst11_1.getLfs().get("lf112"), new Lf("lf112", "lf112 str"));
444
445         Cont lst11_1_cont = lst11_1.getConts().get("cont111");
446         assertEquals(0, lst11_1_cont.getConts().size());
447         assertEquals(1, lst11_1_cont.getLfLsts().size());
448         assertEquals(1, lst11_1_cont.getLfs().size());
449         assertEquals(1, lst11_1_cont.getLsts().size());
450
451         // cont111 check
452         assertEquals(new Lf("lf1111", "lf1111 str"), lst11_1_cont.getLfs().get("lf1111"));
453         assertEquals(new LfLst("lflst1111").addLf(new Lf(2048)).addLf(new Lf(1024)).addLf(new Lf(4096)), lst11_1_cont
454                 .getLfLsts().get("lflst1111"));
455
456         assertNotNull(lst11_1_cont.getLsts().get("lst1111"));
457         checkLst1111(lst11_1_cont.getLsts().get("lst1111").getLstItems(), new Lf("lf1111A", "lf1111A str11"), new Lf(
458                 "lf1111B", 4), new Lf("lf1111A", "lf1111A str12"), new Lf("lf1111B", 7));
459
460         checkLst11x(lst11_1.getLsts().get("lst111"), new LstItem().addLf(new Lf("lf1111", 65)));
461         checkLst11x(lst11_1.getLsts().get("lst112"), new LstItem().addLf(new Lf("lf1121", "lf1121 str11")));
462     }
463
464     private void checkLst11x(Lst lst, LstItem... lstItems) {
465         assertNotNull(lst);
466
467         Lst requiredLst = new Lst(lst.getName());
468         for (LstItem lstItem : lstItems) {
469             requiredLst.addLstItem(lstItem);
470         }
471
472         assertEquals(requiredLst, lst);
473
474     }
475
476     private void checkLst1111(Set<LstItem> lstItems, Lf lf11, Lf lf12, Lf lf21, Lf lf22) {
477         LstItem lst11_1_cont_lst1111_1 = null;
478         LstItem lst11_1_cont_lst1111_2 = null;
479         for (LstItem lstItem : lstItems) {
480             if (new LstItem().addLf(lf11).addLf(lf12).equals(lstItem)) {
481                 lst11_1_cont_lst1111_1 = lstItem;
482             } else if (new LstItem().addLf(lf21).addLf(lf22).equals(lstItem)) {
483                 lst11_1_cont_lst1111_2 = lstItem;
484             }
485         }
486
487         assertNotNull(lst11_1_cont_lst1111_1);
488         assertNotNull(lst11_1_cont_lst1111_2);
489     }
490
491     private CompositeNode prepareCompositeNodeWithEmpties() {
492         MutableCompositeNode cont1 = NodeFactory.createMutableCompositeNode(
493                 TestUtils.buildQName("cont1", "simple:yang:types", "2013-11-5"), null, null, ModifyAction.CREATE, null);
494
495         // lst11_1
496         MutableCompositeNode lst11_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst11"), cont1,
497                 null, ModifyAction.CREATE, null);
498         cont1.getChildren().add(lst11_1);
499
500         MutableSimpleNode<?> lf111_1 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111"), lst11_1,
501                 (short) 1, ModifyAction.CREATE, null);
502         lst11_1.getChildren().add(lf111_1);
503
504         // lst111_1_1
505         MutableCompositeNode lst111_1_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
506                 lst11_1, null, ModifyAction.CREATE, null);
507         lst11_1.getChildren().add(lst111_1_1);
508         MutableSimpleNode<?> lf1111_1_1 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111"),
509                 lst111_1_1, (int) 34, ModifyAction.CREATE, null);
510         lst111_1_1.getChildren().add(lf1111_1_1);
511         lst111_1_1.init();
512         // :lst111_1_1
513
514         // lst111_1_2
515         MutableCompositeNode lst111_1_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
516                 lst11_1, null, ModifyAction.CREATE, null);
517         lst11_1.getChildren().add(lst111_1_2);
518         MutableSimpleNode<?> lf1111_1_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111"),
519                 lst111_1_2, (int) 35, ModifyAction.CREATE, null);
520         lst111_1_2.getChildren().add(lf1111_1_2);
521         lst111_1_2.init();
522         // :lst111_1_2
523
524         // lst111_1_3
525         MutableCompositeNode lst111_1_3 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
526                 lst11_1, null, ModifyAction.CREATE, null);
527         lst11_1.getChildren().add(lst111_1_3);
528         lst111_1_2.init();
529         // :lst111_1_3
530
531         // lst111_1_4
532         MutableCompositeNode lst111_1_4 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
533                 lst11_1, null, ModifyAction.CREATE, null);
534         lst11_1.getChildren().add(lst111_1_4);
535         lst111_1_2.init();
536         // :lst111_1_4
537
538         MutableCompositeNode cont111_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("cont111"),
539                 lst11_1, null, ModifyAction.CREATE, null);
540         lst11_1.getChildren().add(cont111_1);
541
542         lst11_1.init();
543         // :lst11_1
544
545         // lst11_2
546         MutableCompositeNode lst11_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst11"), cont1,
547                 null, ModifyAction.CREATE, null);
548         cont1.getChildren().add(lst11_2);
549
550         MutableSimpleNode<?> lf111_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111"), lst11_2,
551                 (short) 2, ModifyAction.CREATE, null);
552         lst11_2.getChildren().add(lf111_2);
553
554         // cont111_2
555         MutableCompositeNode cont111_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("cont111"),
556                 lst11_2, null, ModifyAction.CREATE, null);
557         lst11_2.getChildren().add(cont111_2);
558
559         MutableSimpleNode<?> lflst1111_2_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lflst1111"),
560                 cont111_2, (int) 1024, ModifyAction.CREATE, null);
561         cont111_2.getChildren().add(lflst1111_2_2);
562         MutableSimpleNode<?> lflst1111_2_3 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lflst1111"),
563                 cont111_2, (int) 4096, ModifyAction.CREATE, null);
564         cont111_2.getChildren().add(lflst1111_2_3);
565
566         // lst1111_2
567         MutableCompositeNode lst1111_2_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
568                 cont111_2, null, ModifyAction.CREATE, null);
569         cont111_2.getChildren().add(lst1111_2_1);
570         MutableSimpleNode<?> lf1111B_2_1 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111B"),
571                 lst1111_2_1, (short) 4, ModifyAction.CREATE, null);
572         lst1111_2_1.getChildren().add(lf1111B_2_1);
573         lst1111_2_1.init();
574
575         MutableCompositeNode lst1111_2_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
576                 cont111_2, null, ModifyAction.CREATE, null);
577         cont111_2.getChildren().add(lst1111_2_2);
578         MutableSimpleNode<?> lf1111A_2_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111A"),
579                 lst1111_2_2, "lf1111A str12", ModifyAction.CREATE, null);
580         lst1111_2_2.getChildren().add(lf1111A_2_2);
581         lst1111_2_2.init();
582         // :lst1111_2
583
584         cont111_2.init();
585         // :cont111_2
586
587         MutableCompositeNode lst112_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst112"), lst11_2,
588                 null, ModifyAction.CREATE, null);
589         lst11_2.getChildren().add(lst112_2);
590         lst112_2.init();
591         lst11_2.init();
592
593         // :lst11_2
594
595         // lst11_3
596         MutableCompositeNode lst11_3 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst11"), cont1,
597                 null, ModifyAction.CREATE, null);
598         cont1.getChildren().add(lst11_3);
599
600         MutableSimpleNode<?> lf111_3 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111"), lst11_3,
601                 (short) 3, ModifyAction.CREATE, null);
602         lst11_3.getChildren().add(lf111_3);
603
604         // cont111_3
605         MutableCompositeNode cont111_3 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("cont111"),
606                 lst11_3, null, ModifyAction.CREATE, null);
607         lst11_3.getChildren().add(cont111_3);
608
609         MutableCompositeNode lst1111_3_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
610                 cont111_3, null, ModifyAction.CREATE, null);
611         cont111_3.getChildren().add(lst1111_3_1);
612         lst1111_3_1.init();
613
614         MutableCompositeNode lst1111_3_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
615                 cont111_3, null, ModifyAction.CREATE, null);
616         cont111_3.getChildren().add(lst1111_3_2);
617         lst1111_3_2.init();
618
619         cont111_3.init();
620         // :cont111_3
621
622         lst11_3.init();
623         // :lst11_3
624
625         cont1.init();
626         return cont1;
627     }
628
629 }