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