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