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