Merge "Fix for Bug 144"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / ToJsonBasicYangTypesTest.java
1 package org.opendaylight.controller.sal.restconf.impl.test;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertFalse;
5 import static org.junit.Assert.assertNotNull;
6 import static org.junit.Assert.assertNull;
7 import static org.junit.Assert.assertTrue;
8
9 import java.io.*;
10 import java.util.*;
11
12 import org.junit.Test;
13 import org.opendaylight.controller.sal.restconf.impl.test.structures.*;
14 import org.opendaylight.yangtools.yang.data.api.*;
15 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
16
17 import com.google.gson.stream.*;
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                 "/yang-to-json-conversion/simple-yang-types", "/yang-to-json-conversion/simple-yang-types/xml");
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("/yang-to-json-conversion/simple-yang-types/xml/data.xml"),
40                 "/yang-to-json-conversion/simple-yang-types", "/yang-to-json-conversion/simple-yang-types/xml");
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 String nextValue(JsonReader jReader) throws IOException {
208         if (jReader.peek().equals(JsonToken.NULL)) {
209             jReader.nextNull();
210             return null;
211         } else {
212             return jReader.nextString();
213         }
214     }
215
216     private Cont jsonReadCont111(JsonReader jReader, Cont cont) throws IOException {
217         jReader.beginObject();
218         cont = jsonReadCont111Elements(jReader, cont);
219         jReader.endObject();
220         return cont;
221     }
222
223     private Cont jsonReadCont111Elements(JsonReader jReader, Cont cont) throws IOException {
224         while (jReader.hasNext()) {
225             String keyName = jReader.nextName();
226             if (keyName.equals("lf1111")) {
227                 cont.addLf(new Lf(keyName, nextValue(jReader)));
228             } else if (keyName.equals("lflst1111")) {
229                 LfLst lfLst = new LfLst(keyName);
230                 lfLst = jsonReadLflstValues(jReader, lfLst);
231                 cont.addLfLst(lfLst);
232             } else if (keyName.equals("lst1111")) {
233                 Lst lst = new Lst(keyName);
234                 lst = jsonReadLst1111(jReader, lst);
235                 cont.addLst(lst);
236             } else {
237                 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
238             }
239         }
240         return cont;
241
242     }
243
244     private Lst jsonReadLst1111(JsonReader jReader, Lst lst) throws IOException {
245         jReader.beginArray();
246         while (jReader.hasNext()) {
247             LstItem lstItem = jsonReadLst1111Elements(jReader);
248             lst.addLstItem(lstItem);
249         }
250         jReader.endArray();
251         return lst;
252     }
253
254     private LstItem jsonReadLst1111Elements(JsonReader jReader) throws IOException {
255         jReader.beginObject();
256         LstItem lstItem = new LstItem();
257         while (jReader.hasNext()) {
258             String keyName = jReader.nextName();
259             if (keyName.equals("lf1111A") || keyName.equals("lf1111B")) {
260                 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
261             }
262         }
263         jReader.endObject();
264         return lstItem;
265     }
266
267     private LfLst jsonReadLflstValues(JsonReader jReader, LfLst lfLst) throws IOException {
268         jReader.beginArray();
269         while (jReader.hasNext()) {
270             lfLst.addLf(new Lf(nextValue(jReader)));
271         }
272         jReader.endArray();
273         return lfLst;
274     }
275
276     private void checkDataFromJsonEmpty(Cont dataFromJson) {
277         assertTrue(dataFromJson.getLfs().isEmpty());
278         assertTrue(dataFromJson.getLfLsts().isEmpty());
279         assertTrue(dataFromJson.getConts().isEmpty());
280
281         Map<String, Lst> lsts = dataFromJson.getLsts();
282         assertEquals(1, lsts.size());
283         Lst lst11 = lsts.get("lst11");
284         assertNotNull(lst11);
285         Set<LstItem> lstItems = lst11.getLstItems();
286         assertNotNull(lstItems);
287
288         LstItem lst11_1 = null;
289         LstItem lst11_2 = null;
290         LstItem lst11_3 = null;
291         for (LstItem lstItem : lstItems) {
292             if (lstItem.getLfs().get("lf111").getValue().equals("1")) {
293                 lst11_1 = lstItem;
294             } else if (lstItem.getLfs().get("lf111").getValue().equals("2")) {
295                 lst11_2 = lstItem;
296             } else if (lstItem.getLfs().get("lf111").getValue().equals("3")) {
297                 lst11_3 = lstItem;
298             }
299         }
300
301         assertNotNull(lst11_1);
302         assertNotNull(lst11_2);
303         assertNotNull(lst11_3);
304
305         // lst11_1
306         assertTrue(lst11_1.getLfLsts().isEmpty());
307         assertEquals(1, lst11_1.getLfs().size());
308         assertEquals(1, lst11_1.getConts().size());
309         assertEquals(1, lst11_1.getLsts().size());
310         assertEquals(lst11_1.getLsts().get("lst111"), new Lst("lst111").addLstItem(new LstItem().addLf("lf1111", "35"))
311                 .addLstItem(new LstItem().addLf("lf1111", "34")).addLstItem(new LstItem()).addLstItem(new LstItem()));
312         assertEquals(lst11_1.getConts().get("cont111"), new Cont("cont111"));
313         // : lst11_1
314
315         // lst11_2
316         assertTrue(lst11_2.getLfLsts().isEmpty());
317         assertEquals(1, lst11_2.getLfs().size());
318         assertEquals(1, lst11_2.getConts().size());
319         assertEquals(1, lst11_2.getLsts().size());
320
321         Cont lst11_2_cont111 = lst11_2.getConts().get("cont111");
322
323         // -cont111
324         assertNotNull(lst11_2_cont111);
325         assertTrue(lst11_2_cont111.getLfs().isEmpty());
326         assertEquals(1, lst11_2_cont111.getLfLsts().size());
327         assertEquals(1, lst11_2_cont111.getLsts().size());
328         assertTrue(lst11_2_cont111.getConts().isEmpty());
329
330         assertEquals(new LfLst("lflst1111").addLf("1024").addLf("4096"), lst11_2_cont111.getLfLsts().get("lflst1111"));
331         assertEquals(
332                 new Lst("lst1111").addLstItem(new LstItem().addLf("lf1111B", "4")).addLstItem(
333                         new LstItem().addLf("lf1111A", "lf1111A str12")), lst11_2_cont111.getLsts().get("lst1111"));
334         // :-cont111
335         assertEquals(lst11_2.getLsts().get("lst112"), new Lst("lst112").addLstItem(new LstItem()));
336         // : lst11_2
337
338         // lst11_3
339         assertEquals(1, lst11_3.getLfs().size());
340         assertTrue(lst11_3.getLfLsts().isEmpty());
341         assertTrue(lst11_3.getLsts().isEmpty());
342         assertTrue(lst11_3.getLsts().isEmpty());
343
344         // -cont111
345         Cont lst11_3_cont111 = lst11_3.getConts().get("cont111");
346         assertEquals(0, lst11_3_cont111.getLfs().size());
347         assertEquals(0, lst11_3_cont111.getLfLsts().size());
348         assertEquals(1, lst11_3_cont111.getLsts().size());
349         assertTrue(lst11_3_cont111.getConts().isEmpty());
350
351         assertEquals(new Lst("lst1111").addLstItem(new LstItem()).addLstItem(new LstItem()), lst11_3_cont111.getLsts()
352                 .get("lst1111"));
353         // :-cont111
354         // : lst11_3
355
356     }
357
358     private void checkDataFromJson(Cont dataFromJson) {
359         assertNotNull(dataFromJson.getLfs().get("lf11"));
360         assertEquals(dataFromJson.getLfs().get("lf11"), new Lf("lf11", "lf"));
361
362         LfLst lflst11 = null;
363         LfLst lflst12 = null;
364
365         lflst11 = dataFromJson.getLfLsts().get("lflst11");
366         lflst12 = dataFromJson.getLfLsts().get("lflst12");
367
368         assertNotNull(lflst11);
369         assertNotNull(lflst12);
370
371         assertEquals(3, lflst11.getLfs().size());
372         assertTrue(lflst11.getLfs().contains(new Lf("55")));
373         assertTrue(lflst11.getLfs().contains(new Lf("56")));
374         assertTrue(lflst11.getLfs().contains(new Lf("57")));
375
376         assertEquals(3, lflst12.getLfs().size());
377         assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str1")));
378         assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str2")));
379         assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str3")));
380
381         assertEquals(1, dataFromJson.getLsts().size());
382         Lst lst11 = dataFromJson.getLsts().get("lst11");
383         assertNotNull(lst11);
384         assertEquals(2, lst11.getLstItems().size());
385
386         LstItem lst11_1 = null;
387         LstItem lst11_2 = null;
388         for (LstItem lstItem : lst11.getLstItems()) {
389             Lf lf = lstItem.getLfs().get("lf111");
390             if (lf != null && lf.getValue().equals("140")) {
391                 lst11_1 = lstItem;
392             } else if (lf != null && lf.getValue().equals("141")) {
393                 lst11_2 = lstItem;
394             }
395         }
396
397         checkLst11_1(lst11_1);
398         checkLst11_2(lst11_2);
399     }
400
401     private void checkLst11_2(LstItem lst11_2) {
402         assertNotNull(lst11_2);
403         assertEquals(2, lst11_2.getLfs().size());
404         assertEquals(1, lst11_2.getConts().size());
405         assertEquals(2, lst11_2.getLsts().size());
406
407         assertEquals(lst11_2.getLfs().get("lf112"), new Lf("lf112", "lf112 str2"));
408
409         Cont lst11_2_cont = lst11_2.getConts().get("cont111");
410         assertEquals(0, lst11_2_cont.getConts().size());
411         assertEquals(1, lst11_2_cont.getLfLsts().size());
412         assertEquals(1, lst11_2_cont.getLfs().size());
413         assertEquals(1, lst11_2_cont.getLsts().size());
414
415         // cont111 check
416         assertEquals(new Lf("lf1111", "lf1111 str2"), lst11_2_cont.getLfs().get("lf1111"));
417         assertEquals(new LfLst("lflst1111").addLf(new Lf("2049")).addLf(new Lf("1025")).addLf(new Lf("4097")),
418                 lst11_2_cont.getLfLsts().get("lflst1111"));
419
420         assertNotNull(lst11_2_cont.getLsts().get("lst1111"));
421         checkLst1111(lst11_2_cont.getLsts().get("lst1111").getLstItems(), new Lf("lf1111A", "lf1111A str21"), new Lf(
422                 "lf1111B", "5"), new Lf("lf1111A", "lf1111A str22"), new Lf("lf1111B", "8"));
423
424         checkLst11x(lst11_2.getLsts().get("lst111"), new LstItem().addLf(new Lf("lf1111", "55")),
425                 new LstItem().addLf(new Lf("lf1111", "56")));
426         checkLst11x(lst11_2.getLsts().get("lst112"), new LstItem().addLf(new Lf("lf1121", "lf1121 str22")),
427                 new LstItem().addLf(new Lf("lf1121", "lf1121 str21")));
428     }
429
430     private void checkLst11_1(LstItem lst11_1) {
431         assertNotNull(lst11_1);
432
433         assertEquals(2, lst11_1.getLfs().size());
434         assertEquals(1, lst11_1.getConts().size());
435         assertEquals(2, lst11_1.getLsts().size());
436
437         assertEquals(lst11_1.getLfs().get("lf112"), new Lf("lf112", "lf112 str"));
438
439         Cont lst11_1_cont = lst11_1.getConts().get("cont111");
440         assertEquals(0, lst11_1_cont.getConts().size());
441         assertEquals(1, lst11_1_cont.getLfLsts().size());
442         assertEquals(1, lst11_1_cont.getLfs().size());
443         assertEquals(1, lst11_1_cont.getLsts().size());
444
445         // cont111 check
446         assertEquals(new Lf("lf1111", "lf1111 str"), lst11_1_cont.getLfs().get("lf1111"));
447         assertEquals(new LfLst("lflst1111").addLf(new Lf("2048")).addLf(new Lf("1024")).addLf(new Lf("4096")),
448                 lst11_1_cont.getLfLsts().get("lflst1111"));
449
450         assertNotNull(lst11_1_cont.getLsts().get("lst1111"));
451         checkLst1111(lst11_1_cont.getLsts().get("lst1111").getLstItems(), new Lf("lf1111A", "lf1111A str11"), new Lf(
452                 "lf1111B", "4"), new Lf("lf1111A", "lf1111A str12"), new Lf("lf1111B", "7"));
453
454         checkLst11x(lst11_1.getLsts().get("lst111"), new LstItem().addLf(new Lf("lf1111", "65")));
455         checkLst11x(lst11_1.getLsts().get("lst112"), new LstItem().addLf(new Lf("lf1121", "lf1121 str11")));
456     }
457
458     private void checkLst11x(Lst lst, LstItem... lstItems) {
459         assertNotNull(lst);
460
461         Lst requiredLst = new Lst(lst.getName());
462         for (LstItem lstItem : lstItems) {
463             requiredLst.addLstItem(lstItem);
464         }
465
466         assertEquals(requiredLst, lst);
467
468     }
469
470     private void checkLst1111(Set<LstItem> lstItems, Lf lf11, Lf lf12, Lf lf21, Lf lf22) {
471         LstItem lst11_1_cont_lst1111_1 = null;
472         LstItem lst11_1_cont_lst1111_2 = null;
473         for (LstItem lstItem : lstItems) {
474             if (new LstItem().addLf(lf11).addLf(lf12).equals(lstItem)) {
475                 lst11_1_cont_lst1111_1 = lstItem;
476             } else if (new LstItem().addLf(lf21).addLf(lf22).equals(lstItem)) {
477                 lst11_1_cont_lst1111_2 = lstItem;
478             }
479         }
480
481         assertNotNull(lst11_1_cont_lst1111_1);
482         assertNotNull(lst11_1_cont_lst1111_2);
483     }
484
485     private CompositeNode prepareCompositeNodeWithEmpties() {
486         MutableCompositeNode cont1 = NodeFactory.createMutableCompositeNode(
487                 TestUtils.buildQName("cont1", "simple:yang:types", "2013-11-5"), null, null, ModifyAction.CREATE, null);
488
489         // lst11_1
490         MutableCompositeNode lst11_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst11"), cont1,
491                 null, ModifyAction.CREATE, null);
492         cont1.getChildren().add(lst11_1);
493
494         MutableSimpleNode<?> lf111_1 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111"), lst11_1, "1",
495                 ModifyAction.CREATE, null);
496         lst11_1.getChildren().add(lf111_1);
497
498         // lst111_1_1
499         MutableCompositeNode lst111_1_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
500                 lst11_1, null, ModifyAction.CREATE, null);
501         lst11_1.getChildren().add(lst111_1_1);
502         MutableSimpleNode<?> lf1111_1_1 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111"),
503                 lst111_1_1, "34", ModifyAction.CREATE, null);
504         lst111_1_1.getChildren().add(lf1111_1_1);
505         lst111_1_1.init();
506         // :lst111_1_1
507
508         // lst111_1_2
509         MutableCompositeNode lst111_1_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
510                 lst11_1, null, ModifyAction.CREATE, null);
511         lst11_1.getChildren().add(lst111_1_2);
512         MutableSimpleNode<?> lf1111_1_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111"),
513                 lst111_1_2, "35", ModifyAction.CREATE, null);
514         lst111_1_2.getChildren().add(lf1111_1_2);
515         lst111_1_2.init();
516         // :lst111_1_2
517
518         // lst111_1_3
519         MutableCompositeNode lst111_1_3 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
520                 lst11_1, null, ModifyAction.CREATE, null);
521         lst11_1.getChildren().add(lst111_1_3);
522         lst111_1_2.init();
523         // :lst111_1_3
524
525         // lst111_1_4
526         MutableCompositeNode lst111_1_4 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst111"),
527                 lst11_1, null, ModifyAction.CREATE, null);
528         lst11_1.getChildren().add(lst111_1_4);
529         lst111_1_2.init();
530         // :lst111_1_4
531
532         MutableCompositeNode cont111_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("cont111"),
533                 lst11_1, null, ModifyAction.CREATE, null);
534         lst11_1.getChildren().add(cont111_1);
535
536         lst11_1.init();
537         // :lst11_1
538
539         // lst11_2
540         MutableCompositeNode lst11_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst11"), cont1,
541                 null, ModifyAction.CREATE, null);
542         cont1.getChildren().add(lst11_2);
543
544         MutableSimpleNode<?> lf111_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111"), lst11_2, "2",
545                 ModifyAction.CREATE, null);
546         lst11_2.getChildren().add(lf111_2);
547
548         // cont111_2
549         MutableCompositeNode cont111_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("cont111"),
550                 lst11_2, null, ModifyAction.CREATE, null);
551         lst11_2.getChildren().add(cont111_2);
552
553         MutableSimpleNode<?> lflst1111_2_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lflst1111"),
554                 cont111_2, "1024", ModifyAction.CREATE, null);
555         cont111_2.getChildren().add(lflst1111_2_2);
556         MutableSimpleNode<?> lflst1111_2_3 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lflst1111"),
557                 cont111_2, "4096", ModifyAction.CREATE, null);
558         cont111_2.getChildren().add(lflst1111_2_3);
559
560         // lst1111_2
561         MutableCompositeNode lst1111_2_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
562                 cont111_2, null, ModifyAction.CREATE, null);
563         cont111_2.getChildren().add(lst1111_2_1);
564         MutableSimpleNode<?> lf1111B_2_1 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111B"),
565                 lst1111_2_1, "4", ModifyAction.CREATE, null);
566         lst1111_2_1.getChildren().add(lf1111B_2_1);
567         lst1111_2_1.init();
568
569         MutableCompositeNode lst1111_2_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
570                 cont111_2, null, ModifyAction.CREATE, null);
571         cont111_2.getChildren().add(lst1111_2_2);
572         MutableSimpleNode<?> lf1111B_2_2 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf1111A"),
573                 lst1111_2_2, "lf1111A str12", ModifyAction.CREATE, null);
574         lst1111_2_2.getChildren().add(lf1111B_2_2);
575         lst1111_2_2.init();
576         // :lst1111_2
577
578         cont111_2.init();
579         // :cont111_2
580
581         MutableCompositeNode lst112_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst112"), lst11_2,
582                 null, ModifyAction.CREATE, null);
583         lst11_2.getChildren().add(lst112_2);
584         lst112_2.init();
585         lst11_2.init();
586
587         // :lst11_2
588
589         // lst11_3
590         MutableCompositeNode lst11_3 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst11"), cont1,
591                 null, ModifyAction.CREATE, null);
592         cont1.getChildren().add(lst11_3);
593
594         MutableSimpleNode<?> lf111_3 = NodeFactory.createMutableSimpleNode(TestUtils.buildQName("lf111"), lst11_3, "3",
595                 ModifyAction.CREATE, null);
596         lst11_3.getChildren().add(lf111_3);
597
598         // cont111_3
599         MutableCompositeNode cont111_3 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("cont111"),
600                 lst11_3, null, ModifyAction.CREATE, null);
601         lst11_3.getChildren().add(cont111_3);
602
603         MutableCompositeNode lst1111_3_1 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
604                 cont111_3, null, ModifyAction.CREATE, null);
605         cont111_3.getChildren().add(lst1111_3_1);
606         lst1111_3_1.init();
607
608         MutableCompositeNode lst1111_3_2 = NodeFactory.createMutableCompositeNode(TestUtils.buildQName("lst1111"),
609                 cont111_3, null, ModifyAction.CREATE, null);
610         cont111_3.getChildren().add(lst1111_3_2);
611         lst1111_3_2.init();
612
613         cont111_3.init();
614         // :cont111_3
615
616         lst11_3.init();
617         // :lst11_3
618
619         cont1.init();
620         return cont1;
621     }
622
623 }