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.TestUtils.*;
20 import java.util.*;
21
22 import org.apache.juneau.common.utils.*;
23 import org.junit.jupiter.params.*;
24 import org.junit.jupiter.params.provider.*;
25
26
27
28
29
30 class BeanProperties_RoundTripTest extends RoundTripTest_Base {
31
32
33
34
35
36 public static class A01 {
37 public List<Long>[] f1;
38 }
39
40 @SuppressWarnings("unchecked")
41 @ParameterizedTest
42 @MethodSource("testers")
43 void a01_arrayOfListOfLongs(RoundTrip_Tester t) throws Exception {
44 var o = new A01();
45 o.f1 = new List[1];
46 o.f1[0] = alist(123L);
47 o = t.roundTrip(o);
48 assertBean(o, "f1{0{0}}", "{{123}}");
49 }
50
51 public static class A02 {
52 public List<Long[]> f1;
53 }
54
55 @ParameterizedTest
56 @MethodSource("testers")
57 void a02_listOfArrayOfLongs(RoundTrip_Tester t) throws Exception {
58 var o = new A02();
59 o.f1 = Utils.<Long[]>alist(new Long[]{123L});
60 o = t.roundTrip(o);
61 assertBean(o, "f1{0{0}}", "{{123}}");
62 }
63
64 public static class A03 {
65 public List<Long>[][] f1;
66 }
67
68 @SuppressWarnings("unchecked")
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] = new List[]{alist(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 = Utils.<Long[][]>alist(new Long[][]{new Long[]{123L}});
88 o = t.roundTrip(o);
89 assertBean(o, "f1{0{0{0}}}", "{{{123}}}");
90 }
91 }