893f19a02c162db2ee280a5f07f00080a2539b45
[olsrd.git] / lib / info.java / org.olsr.v1.info.api / test / org / olsr / v1 / info / api / dto / TestJsonInfoAll.java
1 package org.olsr.v1.info.api.dto;
2
3 import static org.hamcrest.core.IsEqual.equalTo;
4 import static org.hamcrest.core.IsNull.notNullValue;
5 import static org.junit.Assert.assertThat;
6
7 import java.io.File;
8 import java.io.IOException;
9 import java.util.LinkedList;
10 import java.util.List;
11 import java.util.Set;
12 import java.util.TreeSet;
13
14 import org.junit.After;
15 import org.junit.Before;
16 import org.junit.Test;
17
18 @SuppressWarnings("static-method")
19 public class TestJsonInfoAll {
20   private JsonInfoAll impl = null;
21
22   @Before
23   public void setUp() {
24     this.impl = new JsonInfoAll();
25   }
26
27   @After
28   public void tearDown() {
29     this.impl = null;
30   }
31
32   @Test(timeout = 8000)
33   public void testGettersAndSetters() {
34     /* initial */
35     assertThat(this.impl.getNeighbors(), notNullValue());
36     assertThat(Integer.valueOf(this.impl.getNeighbors().size()), equalTo(Integer.valueOf(0)));
37     assertThat(this.impl.getLinks(), notNullValue());
38     assertThat(Integer.valueOf(this.impl.getLinks().size()), equalTo(Integer.valueOf(0)));
39     assertThat(this.impl.getRoutes(), notNullValue());
40     assertThat(Integer.valueOf(this.impl.getRoutes().size()), equalTo(Integer.valueOf(0)));
41     assertThat(this.impl.getHna(), notNullValue());
42     assertThat(Integer.valueOf(this.impl.getHna().size()), equalTo(Integer.valueOf(0)));
43     assertThat(this.impl.getMid(), notNullValue());
44     assertThat(Integer.valueOf(this.impl.getMid().size()), equalTo(Integer.valueOf(0)));
45     assertThat(this.impl.getTopology(), notNullValue());
46     assertThat(Integer.valueOf(this.impl.getTopology().size()), equalTo(Integer.valueOf(0)));
47     assertThat(this.impl.getGateways(), notNullValue());
48     assertThat(this.impl.getInterfaces(), notNullValue());
49     assertThat(Integer.valueOf(this.impl.getInterfaces().size()), equalTo(Integer.valueOf(0)));
50     assertThat(this.impl.getTwoHop(), notNullValue());
51     assertThat(Integer.valueOf(this.impl.getTwoHop().size()), equalTo(Integer.valueOf(0)));
52     assertThat(this.impl.getSgw(), notNullValue());
53     assertThat(this.impl.getPudPosition(), notNullValue());
54     assertThat(this.impl.getVersion(), notNullValue());
55     assertThat(this.impl.getPlugins(), notNullValue());
56     assertThat(Integer.valueOf(this.impl.getPlugins().size()), equalTo(Integer.valueOf(0)));
57     assertThat(this.impl.getConfig(), notNullValue());
58
59     /* set */
60     final Set<JsonInfoNeighborsEntry> neighbors = new TreeSet<>();
61     final JsonInfoNeighborsEntry neighborsEntry = new JsonInfoNeighborsEntry();
62     neighbors.add(neighborsEntry);
63
64     final Set<JsonInfoLinksEntry> links = new TreeSet<>();
65     final JsonInfoLinksEntry linksEntry = new JsonInfoLinksEntry();
66     links.add(linksEntry);
67
68     final Set<JsonInfoRoutesEntry> routes = new TreeSet<>();
69     final JsonInfoRoutesEntry routesEntry = new JsonInfoRoutesEntry();
70     routes.add(routesEntry);
71
72     final Set<JsonInfoHnaEntry> hna = new TreeSet<>();
73     final JsonInfoHnaEntry hnaEntry = new JsonInfoHnaEntry();
74     hna.add(hnaEntry);
75
76     final List<JsonInfoMidEntry> mid = new LinkedList<>();
77     final JsonInfoMidEntry midEntry = new JsonInfoMidEntry();
78     mid.add(midEntry);
79
80     final Set<JsonInfoTopologyEntry> topology = new TreeSet<>();
81     final JsonInfoTopologyEntry topologyEntry = new JsonInfoTopologyEntry();
82     topology.add(topologyEntry);
83
84     final JsonInfoGatewaysFields gateways = new JsonInfoGatewaysFields();
85     final JsonInfoGatewaysEntry gatewaysEntry = new JsonInfoGatewaysEntry();
86     gateways.getIpv4().add(gatewaysEntry);
87
88     final List<JsonInfoInterfacesEntry> interfaces = new LinkedList<>();
89     final JsonInfoInterfacesEntry interfacesEntry = new JsonInfoInterfacesEntry();
90     interfaces.add(interfacesEntry);
91
92     final List<JsonInfoTwoHopEntry> twohop = new LinkedList<>();
93     final JsonInfoTwoHopEntry twohopEntry = new JsonInfoTwoHopEntry();
94     twohop.add(twohopEntry);
95
96     final JsonInfoSgwFields sgw = new JsonInfoSgwFields();
97     final JsonInfoSgwEntry sgwEntry = new JsonInfoSgwEntry();
98     sgw.getIpv4().add(sgwEntry);
99
100     final JsonInfoPudPositionEntry pudPosition = new JsonInfoPudPositionEntry();
101     pudPosition.setLatitude(1.1);
102
103     final JsonInfoVersionEntry version = new JsonInfoVersionEntry();
104     version.setBuildDate("now");
105
106     final List<JsonInfoPluginsEntry> plugins = new LinkedList<>();
107     final JsonInfoPluginsEntry pluginsEntry = new JsonInfoPluginsEntry();
108     plugins.add(pluginsEntry);
109
110     final JsonInfoConfigEntry config = new JsonInfoConfigEntry();
111     config.setExitValue(123);
112
113     this.impl.setNeighbors(neighbors);
114     this.impl.setLinks(links);
115     this.impl.setRoutes(routes);
116     this.impl.setHna(hna);
117     this.impl.setMid(mid);
118     this.impl.setTopology(topology);
119     this.impl.setGateways(gateways);
120     this.impl.setInterfaces(interfaces);
121     this.impl.setTwoHop(twohop);
122     this.impl.setSgw(sgw);
123     this.impl.setPudPosition(pudPosition);
124     this.impl.setVersion(version);
125     this.impl.setPlugins(plugins);
126     this.impl.setConfig(config);
127
128     /* get */
129     assertThat(this.impl.getNeighbors(), equalTo(neighbors));
130     assertThat(Integer.valueOf(this.impl.getNeighbors().size()), equalTo(Integer.valueOf(1)));
131     assertThat(this.impl.getLinks(), equalTo(links));
132     assertThat(Integer.valueOf(this.impl.getLinks().size()), equalTo(Integer.valueOf(1)));
133     assertThat(this.impl.getRoutes(), equalTo(routes));
134     assertThat(Integer.valueOf(this.impl.getRoutes().size()), equalTo(Integer.valueOf(1)));
135     assertThat(this.impl.getHna(), equalTo(hna));
136     assertThat(Integer.valueOf(this.impl.getHna().size()), equalTo(Integer.valueOf(1)));
137     assertThat(this.impl.getMid(), equalTo(mid));
138     assertThat(Integer.valueOf(this.impl.getMid().size()), equalTo(Integer.valueOf(1)));
139     assertThat(this.impl.getTopology(), equalTo(topology));
140     assertThat(Integer.valueOf(this.impl.getTopology().size()), equalTo(Integer.valueOf(1)));
141     assertThat(this.impl.getGateways(), equalTo(gateways));
142     assertThat(this.impl.getInterfaces(), equalTo(interfaces));
143     assertThat(Integer.valueOf(this.impl.getInterfaces().size()), equalTo(Integer.valueOf(1)));
144     assertThat(this.impl.getTwoHop(), equalTo(twohop));
145     assertThat(Integer.valueOf(this.impl.getTwoHop().size()), equalTo(Integer.valueOf(1)));
146     assertThat(this.impl.getSgw(), equalTo(sgw));
147     assertThat(this.impl.getPudPosition(), equalTo(pudPosition));
148     assertThat(this.impl.getVersion(), equalTo(version));
149     assertThat(this.impl.getPlugins(), equalTo(plugins));
150     assertThat(Integer.valueOf(this.impl.getPlugins().size()), equalTo(Integer.valueOf(1)));
151     assertThat(this.impl.getConfig(), equalTo(config));
152
153     /* set */
154     this.impl.setNeighbors(null);
155     this.impl.setLinks(null);
156     this.impl.setRoutes(null);
157     this.impl.setHna(null);
158     this.impl.setMid(null);
159     this.impl.setTopology(null);
160     this.impl.setGateways(null);
161     this.impl.setInterfaces(null);
162     this.impl.setTwoHop(null);
163     this.impl.setSgw(null);
164     this.impl.setPudPosition(null);
165     this.impl.setVersion(null);
166     this.impl.setPlugins(null);
167     this.impl.setConfig(null);
168
169     /* get */
170     assertThat(this.impl.getNeighbors(), notNullValue());
171     assertThat(Integer.valueOf(this.impl.getNeighbors().size()), equalTo(Integer.valueOf(0)));
172     assertThat(this.impl.getLinks(), notNullValue());
173     assertThat(Integer.valueOf(this.impl.getLinks().size()), equalTo(Integer.valueOf(0)));
174     assertThat(this.impl.getRoutes(), notNullValue());
175     assertThat(Integer.valueOf(this.impl.getRoutes().size()), equalTo(Integer.valueOf(0)));
176     assertThat(this.impl.getHna(), notNullValue());
177     assertThat(Integer.valueOf(this.impl.getHna().size()), equalTo(Integer.valueOf(0)));
178     assertThat(this.impl.getMid(), notNullValue());
179     assertThat(Integer.valueOf(this.impl.getMid().size()), equalTo(Integer.valueOf(0)));
180     assertThat(this.impl.getTopology(), notNullValue());
181     assertThat(Integer.valueOf(this.impl.getTopology().size()), equalTo(Integer.valueOf(0)));
182     assertThat(this.impl.getGateways(), notNullValue());
183     assertThat(this.impl.getInterfaces(), notNullValue());
184     assertThat(Integer.valueOf(this.impl.getInterfaces().size()), equalTo(Integer.valueOf(0)));
185     assertThat(this.impl.getTwoHop(), notNullValue());
186     assertThat(Integer.valueOf(this.impl.getTwoHop().size()), equalTo(Integer.valueOf(0)));
187     assertThat(this.impl.getSgw(), notNullValue());
188     assertThat(this.impl.getPudPosition(), notNullValue());
189     assertThat(this.impl.getVersion(), notNullValue());
190     assertThat(this.impl.getPlugins(), notNullValue());
191     assertThat(Integer.valueOf(this.impl.getPlugins().size()), equalTo(Integer.valueOf(0)));
192     assertThat(this.impl.getConfig(), notNullValue());
193   }
194
195   @Test(timeout = 8000)
196   public void testEquals() {
197     final Set<JsonInfoNeighborsEntry> neighbors = new TreeSet<>();
198     final JsonInfoNeighborsEntry neighborsEntry = new JsonInfoNeighborsEntry();
199     neighbors.add(neighborsEntry);
200
201     final Set<JsonInfoLinksEntry> links = new TreeSet<>();
202     final JsonInfoLinksEntry linksEntry = new JsonInfoLinksEntry();
203     links.add(linksEntry);
204
205     final Set<JsonInfoRoutesEntry> routes = new TreeSet<>();
206     final JsonInfoRoutesEntry routesEntry = new JsonInfoRoutesEntry();
207     routes.add(routesEntry);
208
209     final Set<JsonInfoHnaEntry> hna = new TreeSet<>();
210     final JsonInfoHnaEntry hnaEntry = new JsonInfoHnaEntry();
211     hna.add(hnaEntry);
212
213     final List<JsonInfoMidEntry> mid = new LinkedList<>();
214     final JsonInfoMidEntry midEntry = new JsonInfoMidEntry();
215     mid.add(midEntry);
216
217     final Set<JsonInfoTopologyEntry> topology = new TreeSet<>();
218     final JsonInfoTopologyEntry topologyEntry = new JsonInfoTopologyEntry();
219     topology.add(topologyEntry);
220
221     final JsonInfoGatewaysFields gateways = new JsonInfoGatewaysFields();
222     final JsonInfoGatewaysEntry gatewaysEntry = new JsonInfoGatewaysEntry();
223     gateways.getIpv4().add(gatewaysEntry);
224
225     final List<JsonInfoInterfacesEntry> interfaces = new LinkedList<>();
226     final JsonInfoInterfacesEntry interfacesEntry = new JsonInfoInterfacesEntry();
227     interfaces.add(interfacesEntry);
228
229     final List<JsonInfoTwoHopEntry> twohop = new LinkedList<>();
230     final JsonInfoTwoHopEntry twohopEntry = new JsonInfoTwoHopEntry();
231     twohop.add(twohopEntry);
232
233     final JsonInfoSgwFields sgw = new JsonInfoSgwFields();
234     final JsonInfoSgwEntry sgwEntry = new JsonInfoSgwEntry();
235     sgw.getIpv4().add(sgwEntry);
236
237     final JsonInfoPudPositionEntry pudPosition = new JsonInfoPudPositionEntry();
238     pudPosition.setLatitude(1.1);
239
240     final JsonInfoVersionEntry version = new JsonInfoVersionEntry();
241     version.setBuildDate("now");
242
243     final List<JsonInfoPluginsEntry> plugins = new LinkedList<>();
244     final JsonInfoPluginsEntry pluginsEntry = new JsonInfoPluginsEntry();
245     plugins.add(pluginsEntry);
246
247     final JsonInfoConfigEntry config = new JsonInfoConfigEntry();
248     config.setExitValue(123);
249
250     boolean r;
251     final Object otherNull = null;
252     final JsonInfoAll otherEqual = new JsonInfoAll();
253     final JsonInfoAll otherSuperNotEqual = new JsonInfoAll();
254     otherSuperNotEqual.setTimeSinceStartup(321);
255
256     r = this.impl.equals(this.impl);
257     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
258
259     r = this.impl.equals(otherNull);
260     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
261
262     r = this.impl.equals(otherSuperNotEqual);
263     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
264
265     /* neighbors */
266
267     this.impl.setNeighbors(neighbors);
268     r = this.impl.equals(otherEqual);
269     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
270     this.impl.setNeighbors(null);
271
272     /* links */
273
274     this.impl.setLinks(links);
275     r = this.impl.equals(otherEqual);
276     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
277     this.impl.setLinks(null);
278
279     /* routes */
280
281     this.impl.setRoutes(routes);
282     r = this.impl.equals(otherEqual);
283     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
284     this.impl.setRoutes(null);
285
286     /* hna */
287
288     this.impl.setHna(hna);
289     r = this.impl.equals(otherEqual);
290     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
291     this.impl.setHna(null);
292
293     /* mid */
294
295     this.impl.setMid(mid);
296     r = this.impl.equals(otherEqual);
297     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
298     this.impl.setMid(null);
299
300     /* topology */
301
302     this.impl.setTopology(topology);
303     r = this.impl.equals(otherEqual);
304     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
305     this.impl.setTopology(null);
306
307     /* gateways */
308
309     this.impl.setGateways(null);
310     otherEqual.setGateways(null);
311     r = this.impl.equals(otherEqual);
312     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
313
314     this.impl.setGateways(null);
315     otherEqual.setGateways(gateways);
316     r = this.impl.equals(otherEqual);
317     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
318
319     this.impl.setGateways(gateways);
320     otherEqual.setGateways(null);
321     r = this.impl.equals(otherEqual);
322     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
323
324     this.impl.setGateways(gateways);
325     otherEqual.setGateways(gateways);
326     r = this.impl.equals(otherEqual);
327     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
328
329     this.impl.setGateways(null);
330     otherEqual.setGateways(null);
331
332     /* interfaces */
333
334     this.impl.setInterfaces(interfaces);
335     r = this.impl.equals(otherEqual);
336     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
337     this.impl.setInterfaces(null);
338
339     /* twohop */
340
341     this.impl.setTwoHop(twohop);
342     r = this.impl.equals(otherEqual);
343     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
344     this.impl.setTwoHop(null);
345
346     /* sgw */
347
348     this.impl.setSgw(null);
349     otherEqual.setSgw(null);
350     r = this.impl.equals(otherEqual);
351     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
352
353     this.impl.setSgw(null);
354     otherEqual.setSgw(sgw);
355     r = this.impl.equals(otherEqual);
356     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
357
358     this.impl.setSgw(sgw);
359     otherEqual.setSgw(null);
360     r = this.impl.equals(otherEqual);
361     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
362
363     this.impl.setSgw(sgw);
364     otherEqual.setSgw(sgw);
365     r = this.impl.equals(otherEqual);
366     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
367
368     this.impl.setSgw(null);
369     otherEqual.setSgw(null);
370
371     /* pudPosition */
372
373     this.impl.setPudPosition(null);
374     otherEqual.setPudPosition(null);
375     r = this.impl.equals(otherEqual);
376     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
377
378     this.impl.setPudPosition(null);
379     otherEqual.setPudPosition(pudPosition);
380     r = this.impl.equals(otherEqual);
381     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
382
383     this.impl.setPudPosition(pudPosition);
384     otherEqual.setPudPosition(null);
385     r = this.impl.equals(otherEqual);
386     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
387
388     this.impl.setPudPosition(pudPosition);
389     otherEqual.setPudPosition(pudPosition);
390     r = this.impl.equals(otherEqual);
391     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
392
393     this.impl.setPudPosition(null);
394     otherEqual.setPudPosition(null);
395
396     /* version */
397
398     this.impl.setVersion(null);
399     otherEqual.setVersion(null);
400     r = this.impl.equals(otherEqual);
401     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
402
403     this.impl.setVersion(null);
404     otherEqual.setVersion(version);
405     r = this.impl.equals(otherEqual);
406     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
407
408     this.impl.setVersion(version);
409     otherEqual.setVersion(null);
410     r = this.impl.equals(otherEqual);
411     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
412
413     this.impl.setVersion(version);
414     otherEqual.setVersion(version);
415     r = this.impl.equals(otherEqual);
416     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
417
418     this.impl.setVersion(null);
419     otherEqual.setVersion(null);
420
421     /* plugins */
422
423     this.impl.setPlugins(plugins);
424     r = this.impl.equals(otherEqual);
425     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
426     this.impl.setPlugins(null);
427
428     /* config */
429
430     this.impl.setConfig(null);
431     otherEqual.setConfig(null);
432     r = this.impl.equals(otherEqual);
433     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
434
435     this.impl.setConfig(null);
436     otherEqual.setConfig(config);
437     r = this.impl.equals(otherEqual);
438     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
439
440     this.impl.setConfig(config);
441     otherEqual.setConfig(null);
442     r = this.impl.equals(otherEqual);
443     assertThat(Boolean.valueOf(r), equalTo(Boolean.FALSE));
444
445     this.impl.setConfig(config);
446     otherEqual.setConfig(config);
447     r = this.impl.equals(otherEqual);
448     assertThat(Boolean.valueOf(r), equalTo(Boolean.TRUE));
449
450     this.impl.setConfig(null);
451     otherEqual.setConfig(null);
452   }
453
454   @Test(timeout = 8000)
455   public void testHashCode() {
456     this.impl.setNeighbors(null);
457     int r = this.impl.hashCode();
458     assertThat(Integer.valueOf(r), equalTo(Integer.valueOf(-557529111)));
459
460     /* set */
461     final Set<JsonInfoNeighborsEntry> neighbors = new TreeSet<>();
462     final JsonInfoNeighborsEntry neighborsEntry = new JsonInfoNeighborsEntry();
463     neighbors.add(neighborsEntry);
464
465     final Set<JsonInfoLinksEntry> links = new TreeSet<>();
466     final JsonInfoLinksEntry linksEntry = new JsonInfoLinksEntry();
467     links.add(linksEntry);
468
469     final Set<JsonInfoRoutesEntry> routes = new TreeSet<>();
470     final JsonInfoRoutesEntry routesEntry = new JsonInfoRoutesEntry();
471     routes.add(routesEntry);
472
473     final Set<JsonInfoHnaEntry> hna = new TreeSet<>();
474     final JsonInfoHnaEntry hnaEntry = new JsonInfoHnaEntry();
475     hna.add(hnaEntry);
476
477     final List<JsonInfoMidEntry> mid = new LinkedList<>();
478     final JsonInfoMidEntry midEntry = new JsonInfoMidEntry();
479     mid.add(midEntry);
480
481     final Set<JsonInfoTopologyEntry> topology = new TreeSet<>();
482     final JsonInfoTopologyEntry topologyEntry = new JsonInfoTopologyEntry();
483     topology.add(topologyEntry);
484
485     final JsonInfoGatewaysFields gateways = new JsonInfoGatewaysFields();
486     final JsonInfoGatewaysEntry gatewaysEntry = new JsonInfoGatewaysEntry();
487     gateways.getIpv4().add(gatewaysEntry);
488
489     final List<JsonInfoInterfacesEntry> interfaces = new LinkedList<>();
490     final JsonInfoInterfacesEntry interfacesEntry = new JsonInfoInterfacesEntry();
491     interfaces.add(interfacesEntry);
492
493     final List<JsonInfoTwoHopEntry> twohop = new LinkedList<>();
494     final JsonInfoTwoHopEntry twohopEntry = new JsonInfoTwoHopEntry();
495     twohop.add(twohopEntry);
496
497     final JsonInfoSgwFields sgw = new JsonInfoSgwFields();
498     final JsonInfoSgwEntry sgwEntry = new JsonInfoSgwEntry();
499     sgw.getIpv4().add(sgwEntry);
500
501     final JsonInfoPudPositionEntry pudPosition = new JsonInfoPudPositionEntry();
502     pudPosition.setLatitude(1.1);
503
504     final JsonInfoVersionEntry version = new JsonInfoVersionEntry();
505     version.setBuildDate("now");
506
507     final List<JsonInfoPluginsEntry> plugins = new LinkedList<>();
508     final JsonInfoPluginsEntry pluginsEntry = new JsonInfoPluginsEntry();
509     plugins.add(pluginsEntry);
510
511     final JsonInfoConfigEntry config = new JsonInfoConfigEntry();
512     config.setExitValue(123);
513
514     this.impl.setNeighbors(neighbors);
515     this.impl.setLinks(links);
516     this.impl.setRoutes(routes);
517     this.impl.setHna(hna);
518     this.impl.setMid(mid);
519     this.impl.setTopology(topology);
520     this.impl.setGateways(gateways);
521     this.impl.setInterfaces(interfaces);
522     this.impl.setTwoHop(twohop);
523     this.impl.setSgw(sgw);
524     this.impl.setPudPosition(pudPosition);
525     this.impl.setVersion(version);
526     this.impl.setPlugins(plugins);
527     this.impl.setConfig(config);
528
529     r = this.impl.hashCode();
530     assertThat(Integer.valueOf(r), equalTo(Integer.valueOf(-260548917)));
531   }
532
533   @Test(timeout = 8000)
534   public void testToString() {
535     final String r = this.impl.toString();
536     assertThat(r, notNullValue());
537   }
538
539   @Test(timeout = 8000)
540   public void testJSON() throws IOException {
541     final String fn = "doc/examples/all.json";
542
543     final String output = Helpers.readFile(new File(fn));
544     final JsonInfoAll gws = Helpers.objectMapper.readValue(output, JsonInfoAll.class);
545     assertThat(gws, notNullValue());
546   }
547 }