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