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.impl.NodeFactory;
40 public class CnSnJsonBasicYangTypesTest extends YangAndXmlAndDataSchemaLoader {
43 public static void initialize() {
44 dataLoad("/cnsn-to-json/simple-yang-types", 1, "simple-yang-types", "cont1");
48 * Test of json output when as input are specified composite node with empty data + YANG file
52 public void compositeNodeAndYangWithJsonReaderEmptyDataTest() {
53 CompositeNode compositeNode = prepareCompositeNodeWithEmpties();
54 TestUtils.normalizeCompositeNode(compositeNode, modules, searchedModuleName + ":" + searchedDataSchemaName);
55 String jsonOutput = null;
57 jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, dataSchemaNode,
58 StructuredDataToJsonProvider.INSTANCE);
59 } catch (WebApplicationException | IOException e) {
62 verifyJsonOutputForEmptyData(jsonOutput);
66 * Test of json output when as input are specified xml file (no empty elements)and YANG file
69 public void xmlAndYangTypesWithJsonReaderTest() {
70 CompositeNode compositeNode = TestUtils.readInputToCnSn("/cnsn-to-json/simple-yang-types/xml/data.xml",
71 XmlToCompositeNodeProvider.INSTANCE);
72 TestUtils.normalizeCompositeNode(compositeNode, modules, searchedModuleName + ":" + searchedDataSchemaName);
73 String jsonOutput = null;
75 jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, dataSchemaNode,
76 StructuredDataToJsonProvider.INSTANCE);
77 } catch (WebApplicationException | IOException e) {
80 verifyJsonOutput(jsonOutput);
83 private void verifyJsonOutputForEmptyData(final String jsonOutput) {
84 assertNotNull(jsonOutput);
85 StringReader strReader = new StringReader(jsonOutput);
86 JsonReader jReader = new JsonReader(strReader);
88 String exception = null;
89 Cont dataFromJson = null;
91 dataFromJson = jsonReadCont1(jReader);
92 } catch (IOException e) {
93 exception = e.getMessage();
96 assertNotNull("Data structures from json are missing.", dataFromJson);
97 checkDataFromJsonEmpty(dataFromJson);
99 assertNull("Error during reading Json output: " + exception, exception);
102 private void verifyJsonOutput(final String jsonOutput) {
103 assertNotNull(jsonOutput);
104 StringReader strReader = new StringReader(jsonOutput);
105 JsonReader jReader = new JsonReader(strReader);
107 String exception = null;
108 Cont dataFromJson = null;
110 dataFromJson = jsonReadCont1(jReader);
111 } catch (IOException e) {
112 exception = e.getMessage();
115 assertNotNull("Data structures from json are missing.", dataFromJson);
116 checkDataFromJson(dataFromJson);
118 assertNull("Error during reading Json output: " + exception, exception);
121 private Cont jsonReadCont1(final JsonReader jReader) throws IOException {
122 jReader.beginObject();
123 assertNotNull("cont1 is missing.", jReader.hasNext());
125 Cont dataFromJson = new Cont(jReader.nextName());
126 dataFromJson = jsonReadCont1Elements(jReader, dataFromJson);
128 assertFalse("cont shouldn't have other element.", jReader.hasNext());
134 private Cont jsonReadCont1Elements(final JsonReader jReader, final Cont redData) throws IOException {
135 jReader.beginObject();
136 while (jReader.hasNext()) {
137 String keyName = jReader.nextName();
138 if (keyName.equals("lf11")) {
139 redData.addLf(new Lf(keyName, nextValue(jReader)));
140 } else if (keyName.equals("lflst11")) {
141 LfLst lfLst = new LfLst(keyName);
142 lfLst = jsonReadLflstValues(jReader, lfLst);
143 redData.addLfLst(lfLst);
144 } else if (keyName.equals("lflst12")) {
145 LfLst lfLst = new LfLst(keyName);
146 jsonReadLflstValues(jReader, lfLst);
147 redData.addLfLst(lfLst);
148 } else if (keyName.equals("lst11")) {
149 Lst lst = new Lst(keyName);
150 lst = jsonReadLst11(jReader, lst);
153 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
161 private Lst jsonReadLst11(final JsonReader jReader, final Lst lst) throws IOException {
162 jReader.beginArray();
164 while (jReader.hasNext()) {
165 LstItem lstItem = jsonReadLst11Elements(jReader);
166 lst.addLstItem(lstItem);
172 private LstItem jsonReadLst11Elements(final JsonReader jReader) throws IOException {
173 LstItem lstItem = new LstItem();
174 jReader.beginObject();
175 while (jReader.hasNext()) {
176 String keyName = jReader.nextName();
177 if (keyName.equals("lf111")) {
178 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
179 } else if (keyName.equals("lf112")) {
180 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
181 } else if (keyName.equals("cont111")) {
182 Cont cont = new Cont(keyName);
183 cont = jsonReadCont111(jReader, cont);
184 lstItem.addCont(cont);
185 } else if (keyName.equals("lst111")) {
186 Lst lst = new Lst(keyName);
187 lst = jsonReadLst111(jReader, lst);
189 } else if (keyName.equals("lst112")) {
190 Lst lst = new Lst(keyName);
191 lst = jsonReadLst112(jReader, lst);
194 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
201 private Lst jsonReadLst112(final JsonReader jReader, final Lst lst) throws IOException {
202 jReader.beginArray();
203 while (jReader.hasNext()) {
204 LstItem lstItem = jsonReadLst112Elements(jReader);
205 lst.addLstItem(lstItem);
211 private LstItem jsonReadLst112Elements(final JsonReader jReader) throws IOException {
212 LstItem lstItem = new LstItem();
213 jReader.beginObject();
214 if (jReader.hasNext()) {
215 String keyName = jReader.nextName();
216 if (keyName.equals("lf1121")) {
217 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
225 private Lst jsonReadLst111(final JsonReader jReader, final Lst lst) throws IOException {
226 jReader.beginArray();
227 while (jReader.hasNext()) {
228 LstItem lstItem = jsonReadLst111Elements(jReader);
229 lst.addLstItem(lstItem);
235 private LstItem jsonReadLst111Elements(final JsonReader jReader) throws IOException {
236 LstItem lstItem = new LstItem();
237 jReader.beginObject();
238 if (jReader.hasNext()) {
239 String keyName = jReader.nextName();
240 if (keyName.equals("lf1111")) {
241 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
248 private Object nextValue(final JsonReader jReader) throws IOException {
249 if (jReader.peek().equals(JsonToken.NULL)) {
252 } else if (jReader.peek().equals(JsonToken.NUMBER)) {
253 return jReader.nextInt();
255 return jReader.nextString();
259 private Cont jsonReadCont111(final JsonReader jReader, Cont cont) throws IOException {
260 jReader.beginObject();
261 cont = jsonReadCont111Elements(jReader, cont);
266 private Cont jsonReadCont111Elements(final JsonReader jReader, final Cont cont) throws IOException {
267 while (jReader.hasNext()) {
268 String keyName = jReader.nextName();
269 if (keyName.equals("lf1111")) {
270 cont.addLf(new Lf(keyName, nextValue(jReader)));
271 } else if (keyName.equals("lflst1111")) {
272 LfLst lfLst = new LfLst(keyName);
273 lfLst = jsonReadLflstValues(jReader, lfLst);
274 cont.addLfLst(lfLst);
275 } else if (keyName.equals("lst1111")) {
276 Lst lst = new Lst(keyName);
277 lst = jsonReadLst1111(jReader, lst);
280 assertTrue("Key " + keyName + " doesn't exists in yang file.", false);
287 private Lst jsonReadLst1111(final JsonReader jReader, final Lst lst) throws IOException {
288 jReader.beginArray();
289 while (jReader.hasNext()) {
290 LstItem lstItem = jsonReadLst1111Elements(jReader);
291 lst.addLstItem(lstItem);
297 private LstItem jsonReadLst1111Elements(final JsonReader jReader) throws IOException {
298 jReader.beginObject();
299 LstItem lstItem = new LstItem();
300 while (jReader.hasNext()) {
301 String keyName = jReader.nextName();
302 if (keyName.equals("lf1111A") || keyName.equals("lf1111B")) {
303 lstItem.addLf(new Lf(keyName, nextValue(jReader)));
310 private LfLst jsonReadLflstValues(final JsonReader jReader, final LfLst lfLst) throws IOException {
311 jReader.beginArray();
312 while (jReader.hasNext()) {
313 lfLst.addLf(new Lf(nextValue(jReader)));
319 private void checkDataFromJsonEmpty(final Cont dataFromJson) {
320 assertTrue(dataFromJson.getLfs().isEmpty());
321 assertTrue(dataFromJson.getLfLsts().isEmpty());
322 assertTrue(dataFromJson.getConts().isEmpty());
324 Map<String, Lst> lsts = dataFromJson.getLsts();
325 assertEquals(1, lsts.size());
326 Lst lst11 = lsts.get("lst11");
327 assertNotNull(lst11);
328 Set<LstItem> lstItems = lst11.getLstItems();
329 assertNotNull(lstItems);
331 LstItem lst11_1 = null;
332 LstItem lst11_2 = null;
333 LstItem lst11_3 = null;
334 for (LstItem lstItem : lstItems) {
335 if (lstItem.getLfs().get("lf111").getValue().equals(1)) {
337 } else if (lstItem.getLfs().get("lf111").getValue().equals(2)) {
339 } else if (lstItem.getLfs().get("lf111").getValue().equals(3)) {
344 assertNotNull(lst11_1);
345 assertNotNull(lst11_2);
346 assertNotNull(lst11_3);
349 assertTrue(lst11_1.getLfLsts().isEmpty());
350 assertEquals(1, lst11_1.getLfs().size());
351 assertEquals(1, lst11_1.getConts().size());
352 assertEquals(1, lst11_1.getLsts().size());
353 assertEquals(lst11_1.getLsts().get("lst111"), new Lst("lst111").addLstItem(new LstItem().addLf("lf1111", 35))
354 .addLstItem(new LstItem().addLf("lf1111", 34)).addLstItem(new LstItem()).addLstItem(new LstItem()));
355 assertEquals(lst11_1.getConts().get("cont111"), new Cont("cont111"));
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());
364 Cont lst11_2_cont111 = lst11_2.getConts().get("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());
373 assertEquals(new LfLst("lflst1111").addLf(1024).addLf(4096), lst11_2_cont111.getLfLsts().get("lflst1111"));
375 new Lst("lst1111").addLstItem(new LstItem().addLf("lf1111B", 4)).addLstItem(
376 new LstItem().addLf("lf1111A", "lf1111A str12")), lst11_2_cont111.getLsts().get("lst1111"));
378 assertEquals(lst11_2.getLsts().get("lst112"), new Lst("lst112").addLstItem(new LstItem()));
382 assertEquals(1, lst11_3.getLfs().size());
383 assertTrue(lst11_3.getLfLsts().isEmpty());
384 assertTrue(lst11_3.getLsts().isEmpty());
385 assertTrue(lst11_3.getLsts().isEmpty());
388 Cont lst11_3_cont111 = lst11_3.getConts().get("cont111");
389 assertEquals(0, lst11_3_cont111.getLfs().size());
390 assertEquals(0, lst11_3_cont111.getLfLsts().size());
391 assertEquals(1, lst11_3_cont111.getLsts().size());
392 assertTrue(lst11_3_cont111.getConts().isEmpty());
394 assertEquals(new Lst("lst1111").addLstItem(new LstItem()).addLstItem(new LstItem()), lst11_3_cont111.getLsts()
401 private void checkDataFromJson(final Cont dataFromJson) {
402 assertNotNull(dataFromJson.getLfs().get("lf11"));
403 assertEquals(dataFromJson.getLfs().get("lf11"), new Lf("lf11", "lf"));
405 LfLst lflst11 = null;
406 LfLst lflst12 = null;
408 lflst11 = dataFromJson.getLfLsts().get("lflst11");
409 lflst12 = dataFromJson.getLfLsts().get("lflst12");
411 assertNotNull(lflst11);
412 assertNotNull(lflst12);
414 assertEquals(3, lflst11.getLfs().size());
415 assertTrue(lflst11.getLfs().contains(new Lf(55)));
416 assertTrue(lflst11.getLfs().contains(new Lf(56)));
417 assertTrue(lflst11.getLfs().contains(new Lf(57)));
419 assertEquals(3, lflst12.getLfs().size());
420 assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str1")));
421 assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str2")));
422 assertTrue(lflst12.getLfs().contains(new Lf("lflst12 str3")));
424 assertEquals(1, dataFromJson.getLsts().size());
425 Lst lst11 = dataFromJson.getLsts().get("lst11");
426 assertNotNull(lst11);
427 assertEquals(2, lst11.getLstItems().size());
429 LstItem lst11_1 = null;
430 LstItem lst11_2 = null;
431 for (LstItem lstItem : lst11.getLstItems()) {
432 Lf lf = lstItem.getLfs().get("lf111");
433 if (lf != null && lf.getValue().equals(140)) {
435 } else if (lf != null && lf.getValue().equals(141)) {
440 checkLst11_1(lst11_1);
441 checkLst11_2(lst11_2);
444 private void checkLst11_2(final LstItem lst11_2) {
445 assertNotNull(lst11_2);
446 assertEquals(2, lst11_2.getLfs().size());
447 assertEquals(1, lst11_2.getConts().size());
448 assertEquals(2, lst11_2.getLsts().size());
450 assertEquals(lst11_2.getLfs().get("lf112"), new Lf("lf112", "lf112 str2"));
452 Cont lst11_2_cont = lst11_2.getConts().get("cont111");
453 assertEquals(0, lst11_2_cont.getConts().size());
454 assertEquals(1, lst11_2_cont.getLfLsts().size());
455 assertEquals(1, lst11_2_cont.getLfs().size());
456 assertEquals(1, lst11_2_cont.getLsts().size());
459 assertEquals(new Lf("lf1111", "lf1111 str2"), lst11_2_cont.getLfs().get("lf1111"));
460 assertEquals(new LfLst("lflst1111").addLf(new Lf(2049)).addLf(new Lf(1025)).addLf(new Lf(4097)), lst11_2_cont
461 .getLfLsts().get("lflst1111"));
463 assertNotNull(lst11_2_cont.getLsts().get("lst1111"));
464 checkLst1111(lst11_2_cont.getLsts().get("lst1111").getLstItems(), new Lf("lf1111A", "lf1111A str21"), new Lf(
465 "lf1111B", 5), new Lf("lf1111A", "lf1111A str22"), new Lf("lf1111B", 8));
467 checkLst11x(lst11_2.getLsts().get("lst111"), new LstItem().addLf(new Lf("lf1111", 55)),
468 new LstItem().addLf(new Lf("lf1111", 56)));
469 checkLst11x(lst11_2.getLsts().get("lst112"), new LstItem().addLf(new Lf("lf1121", "lf1121 str22")),
470 new LstItem().addLf(new Lf("lf1121", "lf1121 str21")));
473 private void checkLst11_1(final LstItem lst11_1) {
474 assertNotNull(lst11_1);
476 assertEquals(2, lst11_1.getLfs().size());
477 assertEquals(1, lst11_1.getConts().size());
478 assertEquals(2, lst11_1.getLsts().size());
480 assertEquals(lst11_1.getLfs().get("lf112"), new Lf("lf112", "lf112 str"));
482 Cont lst11_1_cont = lst11_1.getConts().get("cont111");
483 assertEquals(0, lst11_1_cont.getConts().size());
484 assertEquals(1, lst11_1_cont.getLfLsts().size());
485 assertEquals(1, lst11_1_cont.getLfs().size());
486 assertEquals(1, lst11_1_cont.getLsts().size());
489 assertEquals(new Lf("lf1111", "lf1111 str"), lst11_1_cont.getLfs().get("lf1111"));
490 assertEquals(new LfLst("lflst1111").addLf(new Lf(2048)).addLf(new Lf(1024)).addLf(new Lf(4096)), lst11_1_cont
491 .getLfLsts().get("lflst1111"));
493 assertNotNull(lst11_1_cont.getLsts().get("lst1111"));
494 checkLst1111(lst11_1_cont.getLsts().get("lst1111").getLstItems(), new Lf("lf1111A", "lf1111A str11"), new Lf(
495 "lf1111B", 4), new Lf("lf1111A", "lf1111A str12"), new Lf("lf1111B", 7));
497 checkLst11x(lst11_1.getLsts().get("lst111"), new LstItem().addLf(new Lf("lf1111", 65)));
498 checkLst11x(lst11_1.getLsts().get("lst112"), new LstItem().addLf(new Lf("lf1121", "lf1121 str11")));
501 private void checkLst11x(final Lst lst, final LstItem... lstItems) {
504 Lst requiredLst = new Lst(lst.getName());
505 for (LstItem lstItem : lstItems) {
506 requiredLst.addLstItem(lstItem);
509 assertEquals(requiredLst, lst);
513 private void checkLst1111(final Set<LstItem> lstItems, final Lf lf11, final Lf lf12, final Lf lf21, final Lf lf22) {
514 LstItem lst11_1_cont_lst1111_1 = null;
515 LstItem lst11_1_cont_lst1111_2 = null;
516 for (LstItem lstItem : lstItems) {
517 if (new LstItem().addLf(lf11).addLf(lf12).equals(lstItem)) {
518 lst11_1_cont_lst1111_1 = lstItem;
519 } else if (new LstItem().addLf(lf21).addLf(lf22).equals(lstItem)) {
520 lst11_1_cont_lst1111_2 = lstItem;
524 assertNotNull(lst11_1_cont_lst1111_1);
525 assertNotNull(lst11_1_cont_lst1111_2);
528 private CompositeNode prepareCompositeNodeWithEmpties() {
529 MutableCompositeNode cont1 = NodeFactory.createMutableCompositeNode(
530 TestUtils.buildQName("cont1", "simple:yang:types", "2013-11-5"), null, null, ModifyAction.CREATE, null);
533 MutableCompositeNode lst11_1 = NodeFactory
534 .createMutableCompositeNode(TestUtils.buildQName("lst11", "simple:yang:types", "2013-11-5"), cont1,
535 null, ModifyAction.CREATE, null);
536 cont1.getValue().add(lst11_1);
538 MutableSimpleNode<?> lf111_1 = NodeFactory.createMutableSimpleNode(
539 TestUtils.buildQName("lf111", "simple:yang:types", "2013-11-5"), lst11_1, (short) 1,
540 ModifyAction.CREATE, null);
541 lst11_1.getValue().add(lf111_1);
544 MutableCompositeNode lst111_1_1 = NodeFactory.createMutableCompositeNode(
545 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
547 lst11_1.getValue().add(lst111_1_1);
548 MutableSimpleNode<?> lf1111_1_1 = NodeFactory.createMutableSimpleNode(
549 TestUtils.buildQName("lf1111", "simple:yang:types", "2013-11-5"), lst111_1_1, 34, ModifyAction.CREATE,
551 lst111_1_1.getValue().add(lf1111_1_1);
556 MutableCompositeNode lst111_1_2 = NodeFactory.createMutableCompositeNode(
557 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
559 lst11_1.getValue().add(lst111_1_2);
560 MutableSimpleNode<?> lf1111_1_2 = NodeFactory.createMutableSimpleNode(
561 TestUtils.buildQName("lf1111", "simple:yang:types", "2013-11-5"), lst111_1_2, 35, ModifyAction.CREATE,
563 lst111_1_2.getValue().add(lf1111_1_2);
568 MutableCompositeNode lst111_1_3 = NodeFactory.createMutableCompositeNode(
569 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
571 lst11_1.getValue().add(lst111_1_3);
576 MutableCompositeNode lst111_1_4 = NodeFactory.createMutableCompositeNode(
577 TestUtils.buildQName("lst111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
579 lst11_1.getValue().add(lst111_1_4);
583 MutableCompositeNode cont111_1 = NodeFactory.createMutableCompositeNode(
584 TestUtils.buildQName("cont111", "simple:yang:types", "2013-11-5"), lst11_1, null, ModifyAction.CREATE,
586 lst11_1.getValue().add(cont111_1);
592 MutableCompositeNode lst11_2 = NodeFactory
593 .createMutableCompositeNode(TestUtils.buildQName("lst11", "simple:yang:types", "2013-11-5"), cont1,
594 null, ModifyAction.CREATE, null);
595 cont1.getValue().add(lst11_2);
597 MutableSimpleNode<?> lf111_2 = NodeFactory.createMutableSimpleNode(
598 TestUtils.buildQName("lf111", "simple:yang:types", "2013-11-5"), lst11_2, (short) 2,
599 ModifyAction.CREATE, null);
600 lst11_2.getValue().add(lf111_2);
603 MutableCompositeNode cont111_2 = NodeFactory.createMutableCompositeNode(
604 TestUtils.buildQName("cont111", "simple:yang:types", "2013-11-5"), lst11_2, null, ModifyAction.CREATE,
606 lst11_2.getValue().add(cont111_2);
608 MutableSimpleNode<?> lflst1111_2_2 = NodeFactory.createMutableSimpleNode(
609 TestUtils.buildQName("lflst1111", "simple:yang:types", "2013-11-5"), cont111_2, 1024,
610 ModifyAction.CREATE, null);
611 cont111_2.getValue().add(lflst1111_2_2);
612 MutableSimpleNode<?> lflst1111_2_3 = NodeFactory.createMutableSimpleNode(
613 TestUtils.buildQName("lflst1111", "simple:yang:types", "2013-11-5"), cont111_2, 4096,
614 ModifyAction.CREATE, null);
615 cont111_2.getValue().add(lflst1111_2_3);
618 MutableCompositeNode lst1111_2_1 = NodeFactory.createMutableCompositeNode(
619 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_2, null,
620 ModifyAction.CREATE, null);
621 cont111_2.getValue().add(lst1111_2_1);
622 MutableSimpleNode<?> lf1111B_2_1 = NodeFactory.createMutableSimpleNode(
623 TestUtils.buildQName("lf1111B", "simple:yang:types", "2013-11-5"), lst1111_2_1, (short) 4,
624 ModifyAction.CREATE, null);
625 lst1111_2_1.getValue().add(lf1111B_2_1);
628 MutableCompositeNode lst1111_2_2 = NodeFactory.createMutableCompositeNode(
629 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_2, null,
630 ModifyAction.CREATE, null);
631 cont111_2.getValue().add(lst1111_2_2);
632 MutableSimpleNode<?> lf1111A_2_2 = NodeFactory.createMutableSimpleNode(
633 TestUtils.buildQName("lf1111A", "simple:yang:types", "2013-11-5"), lst1111_2_2, "lf1111A str12",
634 ModifyAction.CREATE, null);
635 lst1111_2_2.getValue().add(lf1111A_2_2);
642 MutableCompositeNode lst112_2 = NodeFactory.createMutableCompositeNode(
643 TestUtils.buildQName("lst112", "simple:yang:types", "2013-11-5"), lst11_2, null, ModifyAction.CREATE,
645 lst11_2.getValue().add(lst112_2);
652 MutableCompositeNode lst11_3 = NodeFactory
653 .createMutableCompositeNode(TestUtils.buildQName("lst11", "simple:yang:types", "2013-11-5"), cont1,
654 null, ModifyAction.CREATE, null);
655 cont1.getValue().add(lst11_3);
657 MutableSimpleNode<?> lf111_3 = NodeFactory.createMutableSimpleNode(
658 TestUtils.buildQName("lf111", "simple:yang:types", "2013-11-5"), lst11_3, (short) 3,
659 ModifyAction.CREATE, null);
660 lst11_3.getValue().add(lf111_3);
663 MutableCompositeNode cont111_3 = NodeFactory.createMutableCompositeNode(
664 TestUtils.buildQName("cont111", "simple:yang:types", "2013-11-5"), lst11_3, null, ModifyAction.CREATE,
666 lst11_3.getValue().add(cont111_3);
668 MutableCompositeNode lst1111_3_1 = NodeFactory.createMutableCompositeNode(
669 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_3, null,
670 ModifyAction.CREATE, null);
671 cont111_3.getValue().add(lst1111_3_1);
674 MutableCompositeNode lst1111_3_2 = NodeFactory.createMutableCompositeNode(
675 TestUtils.buildQName("lst1111", "simple:yang:types", "2013-11-5"), cont111_3, null,
676 ModifyAction.CREATE, null);
677 cont111_3.getValue().add(lst1111_3_2);