Updated xpath pointing to a module instance under services subtree.
[controller.git] / opendaylight / netconf / config-netconf-connector / src / test / java / org / opendaylight / controller / netconf / confignetconfconnector / NetconfMappingTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.netconf.confignetconfconnector;
10
11 import com.google.common.base.Optional;
12 import com.google.common.base.Preconditions;
13 import com.google.common.collect.Lists;
14 import com.google.common.collect.Maps;
15 import org.junit.Before;
16 import org.junit.Ignore;
17 import org.junit.Test;
18 import org.junit.matchers.JUnitMatchers;
19 import org.mockito.Mock;
20 import org.mockito.MockitoAnnotations;
21 import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
22 import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
23 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
24 import org.opendaylight.controller.config.yang.store.api.YangStoreSnapshot;
25 import org.opendaylight.controller.config.yang.store.impl.MbeParser;
26 import org.opendaylight.controller.config.yang.test.impl.ComplexDtoBInner;
27 import org.opendaylight.controller.config.yang.test.impl.ComplexList;
28 import org.opendaylight.controller.config.yang.test.impl.Deep;
29 import org.opendaylight.controller.config.yang.test.impl.DepTestImplModuleFactory;
30 import org.opendaylight.controller.config.yang.test.impl.DtoAInner;
31 import org.opendaylight.controller.config.yang.test.impl.DtoAInnerInner;
32 import org.opendaylight.controller.config.yang.test.impl.DtoC;
33 import org.opendaylight.controller.config.yang.test.impl.DtoD;
34 import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleFactory;
35 import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModuleMXBean;
36 import org.opendaylight.controller.config.yang.test.impl.Peers;
37 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
38 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
39 import org.opendaylight.controller.netconf.api.NetconfOperationRouter;
40 import org.opendaylight.controller.netconf.confignetconfconnector.operations.Commit;
41 import org.opendaylight.controller.netconf.confignetconfconnector.operations.DiscardChanges;
42 import org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig.EditConfig;
43 import org.opendaylight.controller.netconf.confignetconfconnector.operations.get.Get;
44 import org.opendaylight.controller.netconf.confignetconfconnector.operations.getconfig.GetConfig;
45 import org.opendaylight.controller.netconf.confignetconfconnector.operations.runtimerpc.RuntimeRpc;
46 import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider;
47 import org.opendaylight.controller.netconf.impl.mapping.operations.DefaultCloseSession;
48 import org.opendaylight.controller.netconf.mapping.api.HandlingPriority;
49 import org.opendaylight.controller.netconf.mapping.api.NetconfOperation;
50 import org.opendaylight.controller.netconf.util.test.XmlFileLoader;
51 import org.opendaylight.controller.netconf.util.xml.XmlElement;
52 import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
53 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
54 import org.slf4j.Logger;
55 import org.slf4j.LoggerFactory;
56 import org.w3c.dom.Document;
57 import org.w3c.dom.Element;
58 import org.w3c.dom.NodeList;
59 import org.xml.sax.SAXException;
60
61 import javax.management.InstanceAlreadyExistsException;
62 import javax.management.ObjectName;
63 import javax.xml.parsers.ParserConfigurationException;
64 import java.io.FileNotFoundException;
65 import java.io.IOException;
66 import java.io.InputStream;
67 import java.math.BigInteger;
68 import java.util.ArrayList;
69 import java.util.Arrays;
70 import java.util.Collection;
71 import java.util.List;
72 import java.util.Map;
73
74 import static org.junit.Assert.assertEquals;
75 import static org.junit.Assert.assertThat;
76 import static org.junit.Assert.fail;
77 import static org.mockito.Mockito.doNothing;
78 import static org.mockito.Mockito.doReturn;
79 import static org.mockito.Mockito.verify;
80 import static org.mockito.Mockito.verifyNoMoreInteractions;
81
82
83 public class NetconfMappingTest extends AbstractConfigTest {
84     private static final Logger logger = LoggerFactory.getLogger(NetconfMappingTest.class);
85
86     private static final String INSTANCE_NAME = "test1";
87     private static final String NETCONF_SESSION_ID = "foo";
88     private NetconfTestImplModuleFactory factory;
89     private DepTestImplModuleFactory factory2;
90
91     @Mock
92     YangStoreSnapshot yangStoreSnapshot;
93     @Mock
94     NetconfOperationRouter netconfOperationRouter;
95
96     private TransactionProvider transactionProvider;
97
98     @Before
99     public void setUp() throws Exception {
100         MockitoAnnotations.initMocks(this);
101         doReturn(getMbes()).when(this.yangStoreSnapshot).getModuleMXBeanEntryMap();
102         this.factory = new NetconfTestImplModuleFactory();
103         this.factory2 = new DepTestImplModuleFactory();
104         super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(this.factory, this.factory2));
105
106         transactionProvider = new TransactionProvider(this.configRegistryClient, NETCONF_SESSION_ID);
107     }
108
109     private ObjectName createModule(final String instanceName) throws InstanceAlreadyExistsException {
110         final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
111
112         final ObjectName on = transaction.createModule(this.factory.getImplementationName(), instanceName);
113         final NetconfTestImplModuleMXBean mxBean = transaction.newMXBeanProxy(on, NetconfTestImplModuleMXBean.class);
114         setModule(mxBean, transaction);
115
116         transaction.commit();
117         return on;
118     }
119
120     @Test
121     public void testConfigNetconf() throws Exception {
122
123         createModule(INSTANCE_NAME);
124
125         edit("netconfMessages/editConfig.xml");
126         checkBinaryLeafEdited(getConfigCandidate());
127
128         // default-operation:none, should not affect binary leaf
129         edit("netconfMessages/editConfig_none.xml");
130         checkBinaryLeafEdited(getConfigCandidate());
131
132         // check after edit
133         commit();
134         Element response = getConfigRunning();
135         System.err.println(XmlUtil.toString(response));
136
137         checkBinaryLeafEdited(response);
138         checkTypeConfigAttribute(response);
139         checkTypedefs(response);
140         checkEnum(response);
141         checkBigDecimal(response);
142
143         edit("netconfMessages/editConfig_remove.xml");
144
145         commit();
146         response = getConfigCandidate();
147         final String responseFromCandidate = XmlUtil.toString(response).replaceAll("\\s+", "");
148         // System.out.println(responseFromCandidate);
149         response = getConfigRunning();
150         final String responseFromRunning = XmlUtil.toString(response).replaceAll("\\s+", "");
151         // System.out.println(responseFromRunning);
152         assertEquals(responseFromCandidate, responseFromRunning);
153
154         final String expectedResult = XmlFileLoader.fileToString("netconfMessages/editConfig_expectedResult.xml")
155                 .replaceAll("\\s+", "");
156
157         assertEquals(expectedResult, responseFromRunning);
158         assertEquals(expectedResult, responseFromCandidate);
159
160         edit("netconfMessages/editConfig_none.xml");
161         doNothing().when(netconfOperationRouter).close();
162         closeSession();
163         verify(netconfOperationRouter).close();
164         verifyNoMoreInteractions(netconfOperationRouter);
165     }
166
167     private void checkBigDecimal(Element response) {
168         int size = response.getElementsByTagName("sleep-factor").getLength();
169         assertEquals(1, size);
170     }
171
172     private void closeSession() throws NetconfDocumentedException, ParserConfigurationException, SAXException,
173             IOException {
174         DefaultCloseSession closeOp = new DefaultCloseSession(NETCONF_SESSION_ID);
175         executeOp(closeOp, "netconfMessages/closeSession.xml");
176     }
177
178     private void edit(String resource) throws ParserConfigurationException, SAXException, IOException,
179             NetconfDocumentedException {
180         EditConfig editOp = new EditConfig(yangStoreSnapshot, transactionProvider, configRegistryClient,
181                 NETCONF_SESSION_ID);
182         executeOp(editOp, resource);
183     }
184
185     private void commit() throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException {
186         Commit commitOp = new Commit(transactionProvider, configRegistryClient, NETCONF_SESSION_ID);
187         executeOp(commitOp, "netconfMessages/commit.xml");
188     }
189
190     private Element getConfigCandidate() throws ParserConfigurationException, SAXException, IOException,
191             NetconfDocumentedException {
192         GetConfig getConfigOp = new GetConfig(yangStoreSnapshot, Optional.<String> absent(), transactionProvider,
193                 configRegistryClient, NETCONF_SESSION_ID);
194         return executeOp(getConfigOp, "netconfMessages/getConfig_candidate.xml");
195     }
196
197     private Element getConfigRunning() throws ParserConfigurationException, SAXException, IOException,
198             NetconfDocumentedException {
199         GetConfig getConfigOp = new GetConfig(yangStoreSnapshot, Optional.<String> absent(), transactionProvider,
200                 configRegistryClient, NETCONF_SESSION_ID);
201         return executeOp(getConfigOp, "netconfMessages/getConfig.xml");
202     }
203
204     @Test(expected = NetconfDocumentedException.class)
205     public void testConfigNetconfReplaceDefaultEx() throws Exception {
206
207         createModule(INSTANCE_NAME);
208
209         edit("netconfMessages/editConfig.xml");
210         edit("netconfMessages/editConfig_replace_default_ex.xml");
211     }
212
213     @Test
214     public void testConfigNetconfReplaceDefault() throws Exception {
215
216         createModule(INSTANCE_NAME);
217
218         edit("netconfMessages/editConfig.xml");
219         commit();
220         Element response = getConfigRunning();
221         final int allInstances = response.getElementsByTagName("module").getLength();
222
223         edit("netconfMessages/editConfig_replace_default.xml");
224
225         commit();
226         response = getConfigRunning();
227
228         final int afterReplace = response.getElementsByTagName("module").getLength();
229         assertEquals(4, allInstances);
230         assertEquals(2, afterReplace);
231     }
232
233     @Test(expected = NetconfDocumentedException.class)
234     public void testSameAttrDifferentNamespaces() throws Exception {
235         try {
236             edit("netconfMessages/namespaces/editConfig_sameAttrDifferentNamespaces.xml");
237         } catch (NetconfDocumentedException e) {
238             String message = e.getMessage();
239             assertThat(message,
240                     JUnitMatchers
241                             .containsString("Element simple-long-2 present multiple times with different namespaces"));
242             assertThat(message,
243                     JUnitMatchers.containsString("urn:opendaylight:params:xml:ns:yang:controller:test:impl"));
244             assertThat(message,
245                     JUnitMatchers
246                             .containsString(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG));
247             throw e;
248         }
249     }
250
251     @Test(expected = NetconfDocumentedException.class)
252     public void testDifferentNamespaceInTO() throws Exception {
253         try {
254             edit("netconfMessages/namespaces/editConfig_differentNamespaceTO.xml");
255         } catch (NetconfDocumentedException e) {
256             String message = e.getMessage();
257             assertThat(message, JUnitMatchers.containsString("Unrecognised elements"));
258             assertThat(message, JUnitMatchers.containsString("simple-int2"));
259             assertThat(message, JUnitMatchers.containsString("dto_d"));
260             throw e;
261         }
262     }
263
264     @Test(expected = NetconfDocumentedException.class)
265     public void testSameAttrDifferentNamespacesList() throws Exception {
266         try {
267             edit("netconfMessages/namespaces/editConfig_sameAttrDifferentNamespacesList.xml");
268         } catch (NetconfDocumentedException e) {
269             String message = e.getMessage();
270             assertThat(message,
271                     JUnitMatchers.containsString("Element binaryLeaf present multiple times with different namespaces"));
272             assertThat(message,
273                     JUnitMatchers.containsString("urn:opendaylight:params:xml:ns:yang:controller:test:impl"));
274             assertThat(message,
275                     JUnitMatchers
276                             .containsString(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG));
277             throw e;
278         }
279     }
280
281     @Test
282     public void testTypeNameConfigAttributeMatching() throws Exception {
283         edit("netconfMessages/editConfig.xml");
284         commit();
285         edit("netconfMessages/namespaces/editConfig_typeNameConfigAttributeMatching.xml");
286         commit();
287
288         Element response = getConfigRunning();
289         checkTypeConfigAttribute(response);
290     }
291
292     // TODO add <modules operation="replace"> functionality
293     @Test(expected = NetconfDocumentedException.class)
294     public void testConfigNetconfReplaceModuleEx() throws Exception {
295
296         createModule(INSTANCE_NAME);
297
298         edit("netconfMessages/editConfig.xml");
299         edit("netconfMessages/editConfig_replace_module_ex.xml");
300     }
301
302     @Test
303     public void testUnrecognisedConfigElements() throws Exception {
304
305         String format = "netconfMessages/unrecognised/editConfig_unrecognised%d.xml";
306         final int TESTS_COUNT = 8;
307
308         for (int i = 0; i < TESTS_COUNT; i++) {
309             String file = String.format(format, i + 1);
310             try {
311                 edit(file);
312             } catch (NetconfDocumentedException e) {
313                 assertThat(e.getMessage(), JUnitMatchers.containsString("Unrecognised elements"));
314                 assertThat(e.getMessage(), JUnitMatchers.containsString("unknownAttribute"));
315                 continue;
316             }
317             fail("Unrecognised test should throw exception " + file);
318         }
319     }
320
321     @Test
322     @Ignore
323     // FIXME
324     public void testConfigNetconfReplaceModule() throws Exception {
325
326         createModule(INSTANCE_NAME);
327
328         edit("netconfMessages/editConfig.xml");
329         commit();
330         Element response = getConfigRunning();
331         final int allInstances = response.getElementsByTagName("instance").getLength();
332
333         edit("netconfMessages/editConfig_replace_module.xml");
334
335         commit();
336         response = getConfigRunning();
337         final int afterReplace = response.getElementsByTagName("instance").getLength();
338
339         assertEquals(4 + 4 /* Instances from services */, allInstances);
340         assertEquals(3 + 3, afterReplace);
341     }
342
343     @Test(expected = NetconfDocumentedException.class)
344     public void testEx() throws Exception {
345
346         commit();
347     }
348
349     @Test(expected = NetconfDocumentedException.class)
350     public void testEx2() throws Exception {
351         discard();
352     }
353
354     private void discard() throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException {
355         DiscardChanges discardOp = new DiscardChanges(transactionProvider, configRegistryClient, NETCONF_SESSION_ID);
356         executeOp(discardOp, "netconfMessages/discardChanges.xml");
357     }
358
359     private void checkBinaryLeafEdited(final Element response) {
360         final NodeList children = response.getElementsByTagName("binaryLeaf");
361         assertEquals(3, children.getLength());
362         final StringBuffer buf = new StringBuffer();
363         for (int i = 0; i < 3; i++) {
364             final Element e = (Element) children.item(i);
365             buf.append(XmlElement.fromDomElement(e).getTextContent());
366         }
367         assertEquals("810", buf.toString());
368     }
369
370     private void checkTypedefs(final Element response) {
371         NodeList children = response.getElementsByTagName("extended");
372         assertEquals(1, children.getLength());
373
374         children = response.getElementsByTagName("extended-twice");
375         assertEquals(1, children.getLength());
376     }
377
378     private void checkEnum(final Element response) {
379         XmlElement modulesElement = XmlElement.fromDomElement(response).getOnlyChildElement("data")
380                 .getOnlyChildElement("modules");
381
382         String enumName = "extended-enum";
383         String enumContent = "TWO";
384
385         for (XmlElement moduleElement : modulesElement.getChildElements("module")) {
386             String name = moduleElement.getOnlyChildElement("name").getTextContent();
387             if(name.equals("test1")) {
388                 XmlElement enumAttr = moduleElement.getOnlyChildElement(enumName);
389                 assertEquals(enumContent, enumAttr.getTextContent());
390
391                 return;
392             }
393         }
394
395         fail("Enum attribute " + enumName + ":" + enumContent + " not present in " + XmlUtil.toString(response));
396     }
397
398     private void checkTypeConfigAttribute(Element response) {
399
400         XmlElement modulesElement = XmlElement.fromDomElement(response).getOnlyChildElement("data")
401                 .getOnlyChildElement("modules");
402
403         XmlElement configAttributeType = null;
404         for (XmlElement moduleElement : modulesElement.getChildElements("module")) {
405             for (XmlElement type : moduleElement.getChildElements("type")) {
406                 if (type.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY).equals("") == false) {
407                     configAttributeType = type;
408                 }
409             }
410         }
411
412         assertEquals("configAttributeType", configAttributeType.getTextContent());
413     }
414
415     private Map<String, Map<String, ModuleMXBeanEntry>> getMbes() throws Exception {
416         final List<InputStream> yangDependencies = getYangs();
417
418         final Map<String, Map<String, ModuleMXBeanEntry>> mBeanEntries = Maps.newHashMap();
419         mBeanEntries.putAll(new MbeParser().parseYangFiles(yangDependencies).getModuleMXBeanEntryMap());
420
421         return mBeanEntries;
422     }
423
424     @Test
425     public void testConfigNetconfRuntime() throws Exception {
426
427         createModule(INSTANCE_NAME);
428
429         edit("netconfMessages/editConfig.xml");
430         checkBinaryLeafEdited(getConfigCandidate());
431
432         // check after edit
433         commit();
434         Element response = get();
435
436         assertEquals(2/*With runtime beans*/ + 2 /*Without runtime beans*/, getElementsSize(response, "module"));
437         // data from state
438         assertEquals(2, getElementsSize(response, "asdf"));
439         // data from running config
440         assertEquals(2, getElementsSize(response, "simple-short"));
441
442         assertEquals(8, getElementsSize(response, "inner-running-data"));
443         assertEquals(8, getElementsSize(response, "deep2"));
444         assertEquals(8 * 4, getElementsSize(response, "inner-inner-running-data"));
445         assertEquals(8 * 4, getElementsSize(response, "deep3"));
446         assertEquals(8 * 4 * 2, getElementsSize(response, "list-of-strings"));
447         assertEquals(8, getElementsSize(response, "inner-running-data-additional"));
448         assertEquals(8, getElementsSize(response, "deep4"));
449         // TODO assert keys
450
451         RuntimeRpc netconf = new RuntimeRpc(yangStoreSnapshot, configRegistryClient, NETCONF_SESSION_ID);
452
453         response = executeOp(netconf, "netconfMessages/rpc.xml");
454         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("testarg1".toUpperCase()));
455
456         response = executeOp(netconf, "netconfMessages/rpcInner.xml");
457         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("ok"));
458
459         response = executeOp(netconf, "netconfMessages/rpcInnerInner.xml");
460         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("true"));
461
462         response = executeOp(netconf, "netconfMessages/rpcInnerInner_complex_output.xml");
463         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("1"));
464         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("2"));
465     }
466
467     private Element get() throws NetconfDocumentedException, ParserConfigurationException, SAXException, IOException {
468         Get getOp = new Get(yangStoreSnapshot, configRegistryClient, NETCONF_SESSION_ID);
469         return executeOp(getOp, "netconfMessages/get.xml");
470     }
471
472     private int getElementsSize(Element response, String elementName) {
473         return response.getElementsByTagName(elementName).getLength();
474     }
475
476     private Element executeOp(final NetconfOperation op, final String filename) throws ParserConfigurationException,
477             SAXException, IOException, NetconfDocumentedException {
478
479         final Document request = XmlFileLoader.xmlFileToDocument(filename);
480
481         logger.debug("Executing netconf operation\n{}", XmlUtil.toString(request));
482         HandlingPriority priority = op.canHandle(request);
483
484         Preconditions.checkState(priority != HandlingPriority.CANNOT_HANDLE);
485
486         final Document response = op.handle(request, netconfOperationRouter);
487         logger.debug("Got response\n{}", XmlUtil.toString(response));
488         return response.getDocumentElement();
489     }
490
491     private List<InputStream> getYangs() throws FileNotFoundException {
492         List<String> paths = Arrays.asList("/META-INF/yang/config.yang", "/META-INF/yang/rpc-context.yang",
493                 "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang", "/META-INF/yang/test-types.yang",
494                 "/META-INF/yang/ietf-inet-types.yang");
495         final Collection<InputStream> yangDependencies = new ArrayList<>();
496         for (String path : paths) {
497             final InputStream is = Preconditions
498                     .checkNotNull(getClass().getResourceAsStream(path), path + " not found");
499             yangDependencies.add(is);
500         }
501         return Lists.newArrayList(yangDependencies);
502     }
503
504     private void setModule(final NetconfTestImplModuleMXBean mxBean, final ConfigTransactionJMXClient transaction)
505             throws InstanceAlreadyExistsException {
506         mxBean.setSimpleInt((long) 44);
507         mxBean.setBinaryLeaf(new byte[] { 8, 7, 9 });
508         final DtoD dtob = getDtoD();
509         mxBean.setDtoD(dtob);
510         //
511         final DtoC dtoa = getDtoC();
512         mxBean.setDtoC(dtoa);
513         mxBean.setSimpleBoolean(false);
514         //
515         final Peers p1 = new Peers();
516         p1.setCoreSize(44L);
517         p1.setPort("port1");
518         p1.setSimpleInt3(456);
519         final Peers p2 = new Peers();
520         p2.setCoreSize(44L);
521         p2.setPort("port23");
522         p2.setSimpleInt3(456);
523         mxBean.setPeers(Lists.<Peers> newArrayList(p1, p2));
524         // //
525         mxBean.setSimpleLong(454545L);
526         mxBean.setSimpleLong2(44L);
527         mxBean.setSimpleBigInteger(BigInteger.valueOf(999L));
528         mxBean.setSimpleByte(new Byte((byte) 4));
529         mxBean.setSimpleShort(new Short((short) 4));
530         mxBean.setSimpleTest(545);
531
532         mxBean.setComplexList(Lists.<ComplexList> newArrayList());
533         mxBean.setSimpleList(Lists.<Integer> newArrayList());
534
535         final ObjectName testingDepOn = transaction.createModule(this.factory2.getImplementationName(), "dep");
536         mxBean.setTestingDep(testingDepOn);
537     }
538
539     private static DtoD getDtoD() {
540         final DtoD dtob = new DtoD();
541         dtob.setSimpleInt1((long) 444);
542         dtob.setSimpleInt2((long) 4444);
543         dtob.setSimpleInt3(454);
544         final ComplexDtoBInner dtobInner = new ComplexDtoBInner();
545         final Deep deep = new Deep();
546         deep.setSimpleInt3(4);
547         dtobInner.setDeep(deep);
548         dtobInner.setSimpleInt3(44);
549         dtobInner.setSimpleList(Lists.newArrayList(4));
550         dtob.setComplexDtoBInner(Lists.newArrayList(dtobInner));
551         dtob.setSimpleList(Lists.newArrayList(4));
552         return dtob;
553     }
554
555     private static DtoC getDtoC() {
556         final DtoC dtoa = new DtoC();
557         // dtoa.setSimpleArg((long) 55);
558         final DtoAInner dtoAInner = new DtoAInner();
559         final DtoAInnerInner dtoAInnerInner = new DtoAInnerInner();
560         dtoAInnerInner.setSimpleArg(456L);
561         dtoAInner.setDtoAInnerInner(dtoAInnerInner);
562         dtoAInner.setSimpleArg(44L);
563         dtoa.setDtoAInner(dtoAInner);
564         return dtoa;
565     }
566
567 }