Fixed add/delete/modify RPC for group/flow/remove reach the test provider
[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
136         checkBinaryLeafEdited(response);
137         checkTypeConfigAttribute(response);
138         checkTypedefs(response);
139         checkEnum(response);
140         checkBigDecimal(response);
141
142         edit("netconfMessages/editConfig_remove.xml");
143
144         commit();
145         response = getConfigCandidate();
146         final String responseFromCandidate = XmlUtil.toString(response).replaceAll("\\s+", "");
147         // System.out.println(responseFromCandidate);
148         response = getConfigRunning();
149         final String responseFromRunning = XmlUtil.toString(response).replaceAll("\\s+", "");
150         // System.out.println(responseFromRunning);
151         assertEquals(responseFromCandidate, responseFromRunning);
152
153         final String expectedResult = XmlFileLoader.fileToString("netconfMessages/editConfig_expectedResult.xml")
154                 .replaceAll("\\s+", "");
155
156         assertEquals(expectedResult, responseFromRunning);
157         assertEquals(expectedResult, responseFromCandidate);
158
159         edit("netconfMessages/editConfig_none.xml");
160         doNothing().when(netconfOperationRouter).close();
161         closeSession();
162         verify(netconfOperationRouter).close();
163         verifyNoMoreInteractions(netconfOperationRouter);
164     }
165
166     private void checkBigDecimal(Element response) {
167         int size = response.getElementsByTagName("sleep-factor").getLength();
168         assertEquals(1, size);
169     }
170
171     private void closeSession() throws NetconfDocumentedException, ParserConfigurationException, SAXException,
172             IOException {
173         DefaultCloseSession closeOp = new DefaultCloseSession(NETCONF_SESSION_ID);
174         executeOp(closeOp, "netconfMessages/closeSession.xml");
175     }
176
177     private void edit(String resource) throws ParserConfigurationException, SAXException, IOException,
178             NetconfDocumentedException {
179         EditConfig editOp = new EditConfig(yangStoreSnapshot, transactionProvider, configRegistryClient,
180                 NETCONF_SESSION_ID);
181         executeOp(editOp, resource);
182     }
183
184     private void commit() throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException {
185         Commit commitOp = new Commit(transactionProvider, configRegistryClient, NETCONF_SESSION_ID);
186         executeOp(commitOp, "netconfMessages/commit.xml");
187     }
188
189     private Element getConfigCandidate() throws ParserConfigurationException, SAXException, IOException,
190             NetconfDocumentedException {
191         GetConfig getConfigOp = new GetConfig(yangStoreSnapshot, Optional.<String> absent(), transactionProvider,
192                 configRegistryClient, NETCONF_SESSION_ID);
193         return executeOp(getConfigOp, "netconfMessages/getConfig_candidate.xml");
194     }
195
196     private Element getConfigRunning() throws ParserConfigurationException, SAXException, IOException,
197             NetconfDocumentedException {
198         GetConfig getConfigOp = new GetConfig(yangStoreSnapshot, Optional.<String> absent(), transactionProvider,
199                 configRegistryClient, NETCONF_SESSION_ID);
200         return executeOp(getConfigOp, "netconfMessages/getConfig.xml");
201     }
202
203     @Test(expected = NetconfDocumentedException.class)
204     public void testConfigNetconfReplaceDefaultEx() throws Exception {
205
206         createModule(INSTANCE_NAME);
207
208         edit("netconfMessages/editConfig.xml");
209         edit("netconfMessages/editConfig_replace_default_ex.xml");
210     }
211
212     @Test
213     public void testConfigNetconfReplaceDefault() throws Exception {
214
215         createModule(INSTANCE_NAME);
216
217         edit("netconfMessages/editConfig.xml");
218         commit();
219         Element response = getConfigRunning();
220         final int allInstances = response.getElementsByTagName("module").getLength();
221
222         edit("netconfMessages/editConfig_replace_default.xml");
223
224         commit();
225         response = getConfigRunning();
226
227         final int afterReplace = response.getElementsByTagName("module").getLength();
228         assertEquals(4, allInstances);
229         assertEquals(2, afterReplace);
230     }
231
232     @Test(expected = NetconfDocumentedException.class)
233     public void testSameAttrDifferentNamespaces() throws Exception {
234         try {
235             edit("netconfMessages/namespaces/editConfig_sameAttrDifferentNamespaces.xml");
236         } catch (NetconfDocumentedException e) {
237             String message = e.getMessage();
238             assertThat(message,
239                     JUnitMatchers
240                             .containsString("Element simple-long-2 present multiple times with different namespaces"));
241             assertThat(message,
242                     JUnitMatchers.containsString("urn:opendaylight:params:xml:ns:yang:controller:test:impl"));
243             assertThat(message,
244                     JUnitMatchers
245                             .containsString(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG));
246             throw e;
247         }
248     }
249
250     @Test(expected = NetconfDocumentedException.class)
251     public void testDifferentNamespaceInTO() throws Exception {
252         try {
253             edit("netconfMessages/namespaces/editConfig_differentNamespaceTO.xml");
254         } catch (NetconfDocumentedException e) {
255             String message = e.getMessage();
256             assertThat(message, JUnitMatchers.containsString("Unrecognised elements"));
257             assertThat(message, JUnitMatchers.containsString("simple-int2"));
258             assertThat(message, JUnitMatchers.containsString("dto_d"));
259             throw e;
260         }
261     }
262
263     @Test(expected = NetconfDocumentedException.class)
264     public void testSameAttrDifferentNamespacesList() throws Exception {
265         try {
266             edit("netconfMessages/namespaces/editConfig_sameAttrDifferentNamespacesList.xml");
267         } catch (NetconfDocumentedException e) {
268             String message = e.getMessage();
269             assertThat(message,
270                     JUnitMatchers.containsString("Element binaryLeaf present multiple times with different namespaces"));
271             assertThat(message,
272                     JUnitMatchers.containsString("urn:opendaylight:params:xml:ns:yang:controller:test:impl"));
273             assertThat(message,
274                     JUnitMatchers
275                             .containsString(XmlNetconfConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG));
276             throw e;
277         }
278     }
279
280     @Test
281     public void testTypeNameConfigAttributeMatching() throws Exception {
282         edit("netconfMessages/editConfig.xml");
283         commit();
284         edit("netconfMessages/namespaces/editConfig_typeNameConfigAttributeMatching.xml");
285         commit();
286
287         Element response = getConfigRunning();
288         checkTypeConfigAttribute(response);
289     }
290
291     // TODO add <modules operation="replace"> functionality
292     @Test(expected = NetconfDocumentedException.class)
293     public void testConfigNetconfReplaceModuleEx() throws Exception {
294
295         createModule(INSTANCE_NAME);
296
297         edit("netconfMessages/editConfig.xml");
298         edit("netconfMessages/editConfig_replace_module_ex.xml");
299     }
300
301     @Test
302     public void testUnrecognisedConfigElements() throws Exception {
303
304         String format = "netconfMessages/unrecognised/editConfig_unrecognised%d.xml";
305         final int TESTS_COUNT = 8;
306
307         for (int i = 0; i < TESTS_COUNT; i++) {
308             String file = String.format(format, i + 1);
309             try {
310                 edit(file);
311             } catch (NetconfDocumentedException e) {
312                 assertThat(e.getMessage(), JUnitMatchers.containsString("Unrecognised elements"));
313                 assertThat(e.getMessage(), JUnitMatchers.containsString("unknownAttribute"));
314                 continue;
315             }
316             fail("Unrecognised test should throw exception " + file);
317         }
318     }
319
320     @Test
321     @Ignore
322     // FIXME
323     public void testConfigNetconfReplaceModule() throws Exception {
324
325         createModule(INSTANCE_NAME);
326
327         edit("netconfMessages/editConfig.xml");
328         commit();
329         Element response = getConfigRunning();
330         final int allInstances = response.getElementsByTagName("instance").getLength();
331
332         edit("netconfMessages/editConfig_replace_module.xml");
333
334         commit();
335         response = getConfigRunning();
336         final int afterReplace = response.getElementsByTagName("instance").getLength();
337
338         assertEquals(4 + 4 /* Instances from services */, allInstances);
339         assertEquals(3 + 3, afterReplace);
340     }
341
342     @Test(expected = NetconfDocumentedException.class)
343     public void testEx() throws Exception {
344
345         commit();
346     }
347
348     @Test(expected = NetconfDocumentedException.class)
349     public void testEx2() throws Exception {
350         discard();
351     }
352
353     private void discard() throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException {
354         DiscardChanges discardOp = new DiscardChanges(transactionProvider, configRegistryClient, NETCONF_SESSION_ID);
355         executeOp(discardOp, "netconfMessages/discardChanges.xml");
356     }
357
358     private void checkBinaryLeafEdited(final Element response) {
359         final NodeList children = response.getElementsByTagName("binaryLeaf");
360         assertEquals(3, children.getLength());
361         final StringBuffer buf = new StringBuffer();
362         for (int i = 0; i < 3; i++) {
363             final Element e = (Element) children.item(i);
364             buf.append(XmlElement.fromDomElement(e).getTextContent());
365         }
366         assertEquals("810", buf.toString());
367     }
368
369     private void checkTypedefs(final Element response) {
370         NodeList children = response.getElementsByTagName("extended");
371         assertEquals(1, children.getLength());
372
373         children = response.getElementsByTagName("extended-twice");
374         assertEquals(1, children.getLength());
375     }
376
377     private void checkEnum(final Element response) {
378         XmlElement modulesElement = XmlElement.fromDomElement(response).getOnlyChildElement("data")
379                 .getOnlyChildElement("modules");
380
381         String enumName = "extended-enum";
382         String enumContent = "TWO";
383
384         for (XmlElement moduleElement : modulesElement.getChildElements("module")) {
385             String name = moduleElement.getOnlyChildElement("name").getTextContent();
386             if(name.equals("test1")) {
387                 XmlElement enumAttr = moduleElement.getOnlyChildElement(enumName);
388                 assertEquals(enumContent, enumAttr.getTextContent());
389
390                 return;
391             }
392         }
393
394         fail("Enum attribute " + enumName + ":" + enumContent + " not present in " + XmlUtil.toString(response));
395     }
396
397     private void checkTypeConfigAttribute(Element response) {
398
399         XmlElement modulesElement = XmlElement.fromDomElement(response).getOnlyChildElement("data")
400                 .getOnlyChildElement("modules");
401
402         XmlElement configAttributeType = null;
403         for (XmlElement moduleElement : modulesElement.getChildElements("module")) {
404             for (XmlElement type : moduleElement.getChildElements("type")) {
405                 if (type.getAttribute(XmlUtil.XMLNS_ATTRIBUTE_KEY).equals("") == false) {
406                     configAttributeType = type;
407                 }
408             }
409         }
410
411         assertEquals("configAttributeType", configAttributeType.getTextContent());
412     }
413
414     private Map<String, Map<String, ModuleMXBeanEntry>> getMbes() throws Exception {
415         final List<InputStream> yangDependencies = getYangs();
416
417         final Map<String, Map<String, ModuleMXBeanEntry>> mBeanEntries = Maps.newHashMap();
418         mBeanEntries.putAll(new MbeParser().parseYangFiles(yangDependencies).getModuleMXBeanEntryMap());
419
420         return mBeanEntries;
421     }
422
423     @Test
424     public void testConfigNetconfRuntime() throws Exception {
425
426         createModule(INSTANCE_NAME);
427
428         edit("netconfMessages/editConfig.xml");
429         checkBinaryLeafEdited(getConfigCandidate());
430
431         // check after edit
432         commit();
433         Element response = get();
434
435         assertEquals(2/*With runtime beans*/ + 2 /*Without runtime beans*/, getElementsSize(response, "module"));
436         // data from state
437         assertEquals(2, getElementsSize(response, "asdf"));
438         // data from running config
439         assertEquals(2, getElementsSize(response, "simple-short"));
440
441         assertEquals(8, getElementsSize(response, "inner-running-data"));
442         assertEquals(8, getElementsSize(response, "deep2"));
443         assertEquals(8 * 4, getElementsSize(response, "inner-inner-running-data"));
444         assertEquals(8 * 4, getElementsSize(response, "deep3"));
445         assertEquals(8 * 4 * 2, getElementsSize(response, "list-of-strings"));
446         assertEquals(8, getElementsSize(response, "inner-running-data-additional"));
447         assertEquals(8, getElementsSize(response, "deep4"));
448         // TODO assert keys
449
450         RuntimeRpc netconf = new RuntimeRpc(yangStoreSnapshot, configRegistryClient, NETCONF_SESSION_ID);
451
452         response = executeOp(netconf, "netconfMessages/rpc.xml");
453         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("testarg1".toUpperCase()));
454
455         response = executeOp(netconf, "netconfMessages/rpcInner.xml");
456         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("ok"));
457
458         response = executeOp(netconf, "netconfMessages/rpcInnerInner.xml");
459         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("true"));
460
461         response = executeOp(netconf, "netconfMessages/rpcInnerInner_complex_output.xml");
462         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("1"));
463         assertThat(XmlUtil.toString(response), JUnitMatchers.containsString("2"));
464     }
465
466     private Element get() throws NetconfDocumentedException, ParserConfigurationException, SAXException, IOException {
467         Get getOp = new Get(yangStoreSnapshot, configRegistryClient, NETCONF_SESSION_ID);
468         return executeOp(getOp, "netconfMessages/get.xml");
469     }
470
471     private int getElementsSize(Element response, String elementName) {
472         return response.getElementsByTagName(elementName).getLength();
473     }
474
475     private Element executeOp(final NetconfOperation op, final String filename) throws ParserConfigurationException,
476             SAXException, IOException, NetconfDocumentedException {
477
478         final Document request = XmlFileLoader.xmlFileToDocument(filename);
479
480         logger.debug("Executing netconf operation\n{}", XmlUtil.toString(request));
481         HandlingPriority priority = op.canHandle(request);
482
483         Preconditions.checkState(priority != HandlingPriority.CANNOT_HANDLE);
484
485         final Document response = op.handle(request, netconfOperationRouter);
486         logger.debug("Got response\n{}", XmlUtil.toString(response));
487         return response.getDocumentElement();
488     }
489
490     private List<InputStream> getYangs() throws FileNotFoundException {
491         List<String> paths = Arrays.asList("/META-INF/yang/config.yang", "/META-INF/yang/rpc-context.yang",
492                 "/META-INF/yang/config-test.yang", "/META-INF/yang/config-test-impl.yang", "/META-INF/yang/test-types.yang",
493                 "/META-INF/yang/ietf-inet-types.yang");
494         final Collection<InputStream> yangDependencies = new ArrayList<>();
495         for (String path : paths) {
496             final InputStream is = Preconditions
497                     .checkNotNull(getClass().getResourceAsStream(path), path + " not found");
498             yangDependencies.add(is);
499         }
500         return Lists.newArrayList(yangDependencies);
501     }
502
503     private void setModule(final NetconfTestImplModuleMXBean mxBean, final ConfigTransactionJMXClient transaction)
504             throws InstanceAlreadyExistsException {
505         mxBean.setSimpleInt((long) 44);
506         mxBean.setBinaryLeaf(new byte[] { 8, 7, 9 });
507         final DtoD dtob = getDtoD();
508         mxBean.setDtoD(dtob);
509         //
510         final DtoC dtoa = getDtoC();
511         mxBean.setDtoC(dtoa);
512         mxBean.setSimpleBoolean(false);
513         //
514         final Peers p1 = new Peers();
515         p1.setCoreSize(44L);
516         p1.setPort("port1");
517         p1.setSimpleInt3(456);
518         final Peers p2 = new Peers();
519         p2.setCoreSize(44L);
520         p2.setPort("port23");
521         p2.setSimpleInt3(456);
522         mxBean.setPeers(Lists.<Peers> newArrayList(p1, p2));
523         // //
524         mxBean.setSimpleLong(454545L);
525         mxBean.setSimpleLong2(44L);
526         mxBean.setSimpleBigInteger(BigInteger.valueOf(999L));
527         mxBean.setSimpleByte(new Byte((byte) 4));
528         mxBean.setSimpleShort(new Short((short) 4));
529         mxBean.setSimpleTest(545);
530
531         mxBean.setComplexList(Lists.<ComplexList> newArrayList());
532         mxBean.setSimpleList(Lists.<Integer> newArrayList());
533
534         final ObjectName testingDepOn = transaction.createModule(this.factory2.getImplementationName(), "dep");
535         mxBean.setTestingDep(testingDepOn);
536     }
537
538     private static DtoD getDtoD() {
539         final DtoD dtob = new DtoD();
540         dtob.setSimpleInt1((long) 444);
541         dtob.setSimpleInt2((long) 4444);
542         dtob.setSimpleInt3(454);
543         final ComplexDtoBInner dtobInner = new ComplexDtoBInner();
544         final Deep deep = new Deep();
545         deep.setSimpleInt3(4);
546         dtobInner.setDeep(deep);
547         dtobInner.setSimpleInt3(44);
548         dtobInner.setSimpleList(Lists.newArrayList(4));
549         dtob.setComplexDtoBInner(Lists.newArrayList(dtobInner));
550         dtob.setSimpleList(Lists.newArrayList(4));
551         return dtob;
552     }
553
554     private static DtoC getDtoC() {
555         final DtoC dtoa = new DtoC();
556         // dtoa.setSimpleArg((long) 55);
557         final DtoAInner dtoAInner = new DtoAInner();
558         final DtoAInnerInner dtoAInnerInner = new DtoAInnerInner();
559         dtoAInnerInner.setSimpleArg(456L);
560         dtoAInner.setDtoAInnerInner(dtoAInnerInner);
561         dtoAInner.setSimpleArg(44L);
562         dtoa.setDtoAInner(dtoAInner);
563         return dtoa;
564     }
565
566 }