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