2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.restconf.impl.cnsn.to.json.test;
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;
16 import com.google.gson.stream.JsonReader;
17 import com.google.gson.stream.JsonToken;
18 import java.io.IOException;
19 import java.io.StringReader;
22 import javax.ws.rs.WebApplicationException;
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.api.Node;
39 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
41 public class CnSnJsonBasicYangTypesTest extends YangAndXmlAndDataSchemaLoader {
44 public static void initialize() {
45 dataLoad("/cnsn-to-json/simple-yang-types", 1, "simple-yang-types", "cont1");
49 * Test of json output when as input are specified composite node with empty data + YANG file
53 public void compositeNodeAndYangWithJsonReaderEmptyDataTest() {
54 CompositeNode compositeNode = prepareCompositeNodeWithEmpties();
55 TestUtils.normalizeCompositeNode(compositeNode, modules, searchedModuleName + ":" + searchedDataSchemaName);
56 String jsonOutput = null;
58 jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, dataSchemaNode,
59 StructuredDataToJsonProvider.INSTANCE);
60 } catch (WebApplicationException | IOException e) {
63 verifyJsonOutputForEmptyData(jsonOutput);
67 * Test of json output when as input are specified xml file (no empty elements)and YANG file
70 public void xmlAndYangTypesWithJsonReaderTest() {
71 Node<?> node = TestUtils.readInputToCnSn("/cnsn-to-json/simple-yang-types/xml/data.xml",
72 XmlToCompositeNodeProvider.INSTANCE);
73 TestUtils.normalizeCompositeNode(node, modules, searchedModuleName + ":" + searchedDataSchemaName);
74 String jsonOutput = null;
76 jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(node, modules, dataSchemaNode,
77 StructuredDataToJsonProvider.INSTANCE);
78 } catch (WebApplicationException | IOException e) {
81 verifyJsonOutput(jsonOutput);
84 private void verifyJsonOutputForEmptyData(final String jsonOutput) {
85 assertNotNull(jsonOutput);
86 StringReader strReader = new StringReader(jsonOutput);
87 JsonReader jReader = new JsonReader(strReader);
89 String exception = null;
90 Cont dataFromJson = null;
92 dataFromJson = jsonReadCont1(jReader);
93 } catch (IOException e) {
94 exception = e.getMessage();
97 assertNotNull("Data structures from json are missing.", dataFromJson);
98 checkDataFromJsonEmpty(dataFromJson);
100 assertNull("Error during reading Json output: " + exception, exception);
103 private void verifyJsonOutput(final String jsonOutput) {
104 assertNotNull(jsonOutput);
105 StringReader strReader = new StringReader(jsonOutput);
106 JsonReader jReader = new JsonReader(strReader);
108 String exception = null;
109 Cont dataFromJson = null;
111 dataFromJson = jsonReadCont1(jReader);
112 } catch (IOException e) {
113 exception = e.getMessage();
116 assertNotNull("Data structures from json are missing.", dataFromJson);
117 checkDataFromJson(dataFromJson);
119 assertNull("Error during reading Json output: " + exception, exception);
122 private Cont jsonReadCont1(final JsonReader jReader) throws IOException {
123 jReader.beginObject();
124 assertNotNull("cont1 is missing.", jReader.hasNext());
126 Cont dataFromJson = new Cont(jReader.nextName());
127 dataFromJson = jsonReadCont1Elements(jReader, dataFromJson);
129 assertFalse("cont shouldn't have other element.", jReader.hasNext());
135 private Cont jsonReadCont1Elements(final JsonReader jReader, final Cont redData) throws IOException {
136 jReader.beginObject();
137 while (jReader.hasNext()) {
138 String keyName = jReader.nextName();
139 if (keyName.equals("lf11")) {
140 redData.addLf(new Lf(keyName, nextValue(jReader)));
141 } else if (keyName.equals("lflst11")) {
142 LfLst lfLst = new LfLst(keyName);
143 lfLst = jsonReadLflstValues(jReader, lfLst);
144 redData.addLfLst(lfLst);
145 } else if (keyName.equals("lflst12")) {
146 LfLst lfLst = new LfLst(keyName);
147 jsonReadLflstValues(jReader, lfLst);
148 redData.addLfLst(lfLst);
149 } else if (keyName.equals("lst11")) {
150 Lst lst = new Lst(keyName);
151 lst = jsonReadLst11(jReader, lst);
154 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
162 private Lst jsonReadLst11(final JsonReader jReader, final Lst lst) throws IOException {
163 jReader.beginArray();
165 while (jReader.hasNext()) {
166 LstItem lstItem = jsonReadLst11Elements(jReader);
167 lst.addLstItem(lstItem);
173 private LstItem jsonReadLst11Elements(final JsonReader jReader) throws IOException {
174 LstItem lstItem = new LstItem();
175 jReader.beginObject();
176 while (jReader.hasNext()) {
177 String keyName = jReader.nextName();
178 if (keyName.equals("lf111")) {
179 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
180 } else if (keyName.equals("lf112")) {
181 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
182 } else if (keyName.equals("cont111")) {
183 Cont cont = new Cont(keyName);
184 cont = jsonReadCont111(jReader, cont);
185 lstItem.addCont(cont);
186 } else if (keyName.equals("lst111")) {
187 Lst lst = new Lst(keyName);
188 lst = jsonReadLst111(jReader, lst);
190 } else if (keyName.equals("lst112")) {
191 Lst lst = new Lst(keyName);
192 lst = jsonReadLst112(jReader, lst);
195 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
202 private Lst jsonReadLst112(final JsonReader jReader, final Lst lst) throws IOException {
203 jReader.beginArray();
204 while (jReader.hasNext()) {
205 LstItem lstItem = jsonReadLst112Elements(jReader);
206 lst.addLstItem(lstItem);
212 private LstItem jsonReadLst112Elements(final JsonReader jReader) throws IOException {
213 LstItem lstItem = new LstItem();
214 jReader.beginObject();
215 if (jReader.hasNext()) {
216 String keyName = jReader.nextName();
217 if (keyName.equals("lf1121")) {
218 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
226 private Lst jsonReadLst111(final JsonReader jReader, final Lst lst) throws IOException {
227 jReader.beginArray();
228 while (jReader.hasNext()) {
229 LstItem lstItem = jsonReadLst111Elements(jReader);
230 lst.addLstItem(lstItem);
236 private LstItem jsonReadLst111Elements(final JsonReader jReader) throws IOException {
237 LstItem lstItem = new LstItem();
238 jReader.beginObject();
239 if (jReader.hasNext()) {
240 String keyName = jReader.nextName();
241 if (keyName.equals("lf1111")) {
242 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
249 private Object nextValue(final JsonReader jReader) throws IOException {
250 if (jReader.peek().equals(JsonToken.NULL)) {
253 } else if (jReader.peek().equals(JsonToken.NUMBER)) {
254 return jReader.nextInt();
256 return jReader.nextString();
260 private Cont jsonReadCont111(final JsonReader jReader, Cont cont) throws IOException {
261 jReader.beginObject();
262 cont = jsonReadCont111Elements(jReader, cont);
267 private Cont jsonReadCont111Elements(final JsonReader jReader, final Cont cont) throws IOException {
268 while (jReader.hasNext()) {
269 String keyName = jReader.nextName();
270 if (keyName.equals("lf1111")) {
271 cont.addLf(new Lf(keyName, nextValue(jReader)));
272 } else if (keyName.equals("lflst1111")) {
273 LfLst lfLst = new LfLst(keyName);
274 lfLst = jsonReadLflstValues(jReader, lfLst);
275 cont.addLfLst(lfLst);
276 } else if (keyName.equals("lst1111")) {
277 Lst lst = new Lst(keyName);
278 lst = jsonReadLst1111(jReader, lst);
281 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
288 private Lst jsonReadLst1111(final JsonReader jReader, final Lst lst) throws IOException {
289 jReader.beginArray();
290 while (jReader.hasNext()) {
291 LstItem lstItem = jsonReadLst1111Elements(jReader);
292 lst.addLstItem(lstItem);
298 private LstItem jsonReadLst1111Elements(final JsonReader jReader) throws IOException {
299 jReader.beginObject();
300 LstItem lstItem = new LstItem();
301 while (jReader.hasNext()) {
302 String keyName = jReader.nextName();
303 if (keyName.equals("lf1111A") || keyName.equals("lf1111B")) {
304 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
311 private LfLst jsonReadLflstValues(final JsonReader jReader, final LfLst lfLst) throws IOException {
312 jReader.beginArray();
313 while (jReader.hasNext()) {
314 lfLst.addLf(new Lf(nextValue(jReader)));
320 private void checkDataFromJsonEmpty(final Cont dataFromJson) {
321 assertTrue(dataFromJson.getLfs().isEmpty());
322 assertTrue(dataFromJson.getLfLsts().isEmpty());
323 assertTrue(dataFromJson.getConts().isEmpty());
325 Map<String, Lst> lsts = dataFromJson.getLsts();
326 assertEquals(1, lsts.size());
327 Lst lst11 = lsts.get("lst11");
328 assertNotNull(lst11);
329 Set<LstItem> lstItems = lst11.getLstItems();
330 assertNotNull(lstItems);
332 LstItem lst11_1 = null;
333 LstItem lst11_2 = null;
334 LstItem lst11_3 = null;
335 for (LstItem lstItem : lstItems) {
336 if (lstItem.getLfs().get("lf111").getValue().equals(1)) {
338 } else if (lstItem.getLfs().get("lf111").getValue().equals(2)) {
340 } else if (lstItem.getLfs().get("lf111").getValue().equals(3)) {
345 assertNotNull(lst11_1);
346 assertNotNull(lst11_2);
347 assertNotNull(lst11_3);
350 assertTrue(lst11_1.getLfLsts().isEmpty());
351 assertEquals(1, lst11_1.getLfs().size());
352 assertEquals(1, lst11_1.getConts().size());
353 assertEquals(1, lst11_1.getLsts().size());
354 assertEquals(lst11_1.getLsts().get("lst111"), new Lst("lst111").addLstItem(new LstItem().addLf("lf1111", 35))
355 .addLstItem(new LstItem().addLf("lf1111", 34)).addLstItem(new LstItem()).addLstItem(new LstItem()));
356 assertEquals(lst11_1.getConts().get("cont111"), new Cont("cont111"));
360 assertTrue(lst11_2.getLfLsts().isEmpty());
361 assertEquals(1, lst11_2.getLfs().size());
362 assertEquals(1, lst11_2.getConts().size());
363 assertEquals(1, lst11_2.getLsts().size());
365 Cont lst11_2_cont111 = lst11_2.getConts().get("cont111");
368 assertNotNull(lst11_2_cont111);
369 assertTrue(lst11_2_cont111.getLfs().isEmpty());
370 assertEquals(1, lst11_2_cont111.getLfLsts().size());
371 assertEquals(1, lst11_2_cont111.getLsts().size());
372 assertTrue(lst11_2_cont111.getConts().isEmpty());
374 assertEquals(new LfLst("lflst1111").addLf(1024).addLf(4096), lst11_2_cont111.getLfLsts().get("lflst1111"));
376 new Lst("lst1111").addLstItem(new LstItem().addLf("lf1111B", 4)).addLstItem(
377 new LstItem().addLf("lf1111A", "lf1111A str12")), lst11_2_cont111.getLsts().get("lst1111"));
379 assertEquals(lst11_2.getLsts().get("lst112"), new Lst("lst112").addLstItem(new LstItem()));
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());
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());
395 assertEquals(new Lst("lst1111").addLstItem(new LstItem()).addLstItem(new LstItem()), lst11_3_cont111.getLsts()
402 private void checkDataFromJson(final Cont dataFromJson) {
403 assertNotNull(dataFromJson.getLfs().get("lf11"));
404 assertEquals(dataFromJson.getLfs().get("lf11"), new Lf("lf11", "lf"));
406 LfLst lflst11 = null;
407 LfLst lflst12 = null;
409 lflst11 = dataFromJson.getLfLsts().get("lflst11");
410 lflst12 = dataFromJson.getLfLsts().get("lflst12");
412 assertNotNull(lflst11);
413 assertNotNull(lflst12);
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)));
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")));
425 assertEquals(1, dataFromJson.getLsts().size());
426 Lst lst11 = dataFromJson.getLsts().get("lst11");
427 assertNotNull(lst11);
428 assertEquals(2, lst11.getLstItems().size());
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)) {
436 } else if (lf != null && lf.getValue().equals(141)) {
441 checkLst11_1(lst11_1);
442 checkLst11_2(lst11_2);
445 private void checkLst11_2(final 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());
451 assertEquals(lst11_2.getLfs().get("lf112"), new Lf("lf112", "lf112 str2"));
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());
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"));
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));
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")));
474 private void checkLst11_1(final LstItem lst11_1) {
475 assertNotNull(lst11_1);
477 assertEquals(2, lst11_1.getLfs().size());
478 assertEquals(1, lst11_1.getConts().size());
479 assertEquals(2, lst11_1.getLsts().size());
481 assertEquals(lst11_1.getLfs().get("lf112"), new Lf("lf112", "lf112 str"));
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());
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"));
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));
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")));
502 private void checkLst11x(final Lst lst, final LstItem... lstItems) {
505 Lst requiredLst = new Lst(lst.getName());
506 for (LstItem lstItem : lstItems) {
507 requiredLst.addLstItem(lstItem);
510 assertEquals(requiredLst, lst);
514 private void checkLst1111(final Set<LstItem> lstItems, final Lf lf11, final Lf lf12, final Lf lf21, final 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;
525 assertNotNull(lst11_1_cont_lst1111_1);
526 assertNotNull(lst11_1_cont_lst1111_2);
529 private CompositeNode prepareCompositeNodeWithEmpties() {
530 MutableCompositeNode cont1 = NodeFactory.createMutableCompositeNode(
531 TestUtils.buildQName("cont1", "simple:yang:types", "2013-11-5"), null, null, ModifyAction.CREATE, null);
534 MutableCompositeNode lst11_1 = NodeFactory
535 .createMutableCompositeNode(TestUtils.buildQName("lst11", "simple:yang:types", "2013-11-5"), cont1,
536 null, ModifyAction.CREATE, null);
537 cont1.getValue().add(lst11_1);
539 MutableSimpleNode<?> lf111_1 = NodeFactory.createMutableSimpleNode(
540 TestUtils.buildQName("lf111", "simple:yang:types", "2013-11-5"), lst11_1, (short) 1,
541 ModifyAction.CREATE, null);
542 lst11_1.getValue().add(lf111_1);
545 MutableCompositeNode lst111_1_1 = NodeFactory.createMutableCompositeNode(
546 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
548 lst11_1.getValue().add(lst111_1_1);
549 MutableSimpleNode<?> lf1111_1_1 = NodeFactory.createMutableSimpleNode(
550 TestUtils.buildQName("lf1111", "simple:yang:types", "2013-11-5"), lst111_1_1, 34, ModifyAction.CREATE,
552 lst111_1_1.getValue().add(lf1111_1_1);
557 MutableCompositeNode lst111_1_2 = NodeFactory.createMutableCompositeNode(
558 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
560 lst11_1.getValue().add(lst111_1_2);
561 MutableSimpleNode<?> lf1111_1_2 = NodeFactory.createMutableSimpleNode(
562 TestUtils.buildQName("lf1111", "simple:yang:types", "2013-11-5"), lst111_1_2, 35, ModifyAction.CREATE,
564 lst111_1_2.getValue().add(lf1111_1_2);
569 MutableCompositeNode lst111_1_3 = NodeFactory.createMutableCompositeNode(
570 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
572 lst11_1.getValue().add(lst111_1_3);
577 MutableCompositeNode lst111_1_4 = NodeFactory.createMutableCompositeNode(
578 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
580 lst11_1.getValue().add(lst111_1_4);
584 MutableCompositeNode cont111_1 = NodeFactory.createMutableCompositeNode(
585 TestUtils.buildQName("cont111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
587 lst11_1.getValue().add(cont111_1);
593 MutableCompositeNode lst11_2 = NodeFactory
594 .createMutableCompositeNode(TestUtils.buildQName("lst11", "simple:yang:types", "2013-11-5"), cont1,
595 null, ModifyAction.CREATE, null);
596 cont1.getValue().add(lst11_2);
598 MutableSimpleNode<?> lf111_2 = NodeFactory.createMutableSimpleNode(
599 TestUtils.buildQName("lf111", "simple:yang:types", "2013-11-5"), lst11_2, (short) 2,
600 ModifyAction.CREATE, null);
601 lst11_2.getValue().add(lf111_2);
604 MutableCompositeNode cont111_2 = NodeFactory.createMutableCompositeNode(
605 TestUtils.buildQName("cont111", "simple:yang:types", "2013-11-5"), lst11_2, null, ModifyAction.CREATE,
607 lst11_2.getValue().add(cont111_2);
609 MutableSimpleNode<?> lflst1111_2_2 = NodeFactory.createMutableSimpleNode(
610 TestUtils.buildQName("lflst1111", "simple:yang:types", "2013-11-5"), cont111_2, 1024,
611 ModifyAction.CREATE, null);
612 cont111_2.getValue().add(lflst1111_2_2);
613 MutableSimpleNode<?> lflst1111_2_3 = NodeFactory.createMutableSimpleNode(
614 TestUtils.buildQName("lflst1111", "simple:yang:types", "2013-11-5"), cont111_2, 4096,
615 ModifyAction.CREATE, null);
616 cont111_2.getValue().add(lflst1111_2_3);
619 MutableCompositeNode lst1111_2_1 = NodeFactory.createMutableCompositeNode(
620 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_2, null,
621 ModifyAction.CREATE, null);
622 cont111_2.getValue().add(lst1111_2_1);
623 MutableSimpleNode<?> lf1111B_2_1 = NodeFactory.createMutableSimpleNode(
624 TestUtils.buildQName("lf1111B", "simple:yang:types", "2013-11-5"), lst1111_2_1, (short) 4,
625 ModifyAction.CREATE, null);
626 lst1111_2_1.getValue().add(lf1111B_2_1);
629 MutableCompositeNode lst1111_2_2 = NodeFactory.createMutableCompositeNode(
630 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_2, null,
631 ModifyAction.CREATE, null);
632 cont111_2.getValue().add(lst1111_2_2);
633 MutableSimpleNode<?> lf1111A_2_2 = NodeFactory.createMutableSimpleNode(
634 TestUtils.buildQName("lf1111A", "simple:yang:types", "2013-11-5"), lst1111_2_2, "lf1111A str12",
635 ModifyAction.CREATE, null);
636 lst1111_2_2.getValue().add(lf1111A_2_2);
643 MutableCompositeNode lst112_2 = NodeFactory.createMutableCompositeNode(
644 TestUtils.buildQName("lst112", "simple:yang:types", "2013-11-5"), lst11_2, null, ModifyAction.CREATE,
646 lst11_2.getValue().add(lst112_2);
653 MutableCompositeNode lst11_3 = NodeFactory
654 .createMutableCompositeNode(TestUtils.buildQName("lst11", "simple:yang:types", "2013-11-5"), cont1,
655 null, ModifyAction.CREATE, null);
656 cont1.getValue().add(lst11_3);
658 MutableSimpleNode<?> lf111_3 = NodeFactory.createMutableSimpleNode(
659 TestUtils.buildQName("lf111", "simple:yang:types", "2013-11-5"), lst11_3, (short) 3,
660 ModifyAction.CREATE, null);
661 lst11_3.getValue().add(lf111_3);
664 MutableCompositeNode cont111_3 = NodeFactory.createMutableCompositeNode(
665 TestUtils.buildQName("cont111", "simple:yang:types", "2013-11-5"), lst11_3, null, ModifyAction.CREATE,
667 lst11_3.getValue().add(cont111_3);
669 MutableCompositeNode lst1111_3_1 = NodeFactory.createMutableCompositeNode(
670 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_3, null,
671 ModifyAction.CREATE, null);
672 cont111_3.getValue().add(lst1111_3_1);
675 MutableCompositeNode lst1111_3_2 = NodeFactory.createMutableCompositeNode(
676 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_3, null,
677 ModifyAction.CREATE, null);
678 cont111_3.getValue().add(lst1111_3_2);