1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.juneau.a.rttests;
18
19 import static org.apache.juneau.commons.utils.CollectionUtils.*;
20 import static org.apache.juneau.junit.bct.BctAssertions.*;
21
22 import java.util.*;
23
24 import org.apache.juneau.commons.utils.*;
25 import org.junit.jupiter.params.*;
26 import org.junit.jupiter.params.provider.*;
27
28
29
30
31
32 class BeanProperties_RoundTripTest extends RoundTripTest_Base {
33
34
35
36
37
38 public static class A01 {
39 public List<Long>[] f1;
40 }
41
42 @ParameterizedTest
43 @MethodSource("testers")
44 void a01_arrayOfListOfLongs(RoundTrip_Tester t) throws Exception {
45 var o = new A01();
46 o.f1 = new List[1];
47 o.f1[0] = l(123L);
48 o = t.roundTrip(o);
49 assertBean(o, "f1{0{0}}", "{{123}}");
50 }
51
52 public static class A02 {
53 public List<Long[]> f1;
54 }
55
56 @ParameterizedTest
57 @MethodSource("testers")
58 void a02_listOfArrayOfLongs(RoundTrip_Tester t) throws Exception {
59 var o = new A02();
60 o.f1 = CollectionUtils.<Long[]>l(a(123L));
61 o = t.roundTrip(o);
62 assertBean(o, "f1{0{0}}", "{{123}}");
63 }
64
65 public static class A03 {
66 public List<Long>[][] f1;
67 }
68
69 @ParameterizedTest
70 @MethodSource("testers")
71 void a03_2dArrayOfListOfLongs(RoundTrip_Tester t) throws Exception {
72 var o = new A03();
73 o.f1 = new List[1][1];
74 o.f1[0] = a(l(123L));
75 o = t.roundTrip(o);
76 assertBean(o, "f1{0{0{0}}}", "{{{123}}}");
77 }
78
79 public static class A04 {
80 public List<Long[][]> f1;
81 }
82
83 @ParameterizedTest
84 @MethodSource("testers")
85 void a04_listOf2dArrayOfLongs(RoundTrip_Tester t) throws Exception {
86 var o = new A04();
87 o.f1 = CollectionUtils.<Long[][]>l(a2(a(123L)));
88 o = t.roundTrip(o);
89 assertBean(o, "f1{0{0{0}}}", "{{{123}}}");
90 }
91 }