@@ -53,24 +53,34 @@ public void testShortArrayRead() throws Exception {
53
53
}
54
54
55
55
@ Test
56
- public void testShortArrayArrayWrite () throws Exception {
56
+ public void testShortArrayWrite () throws Exception {
57
57
assertEquals (SHORT_ARRAY_JSON , JSON .std .asString (SHORT_ARRAY ));
58
58
}
59
59
60
+ private final static String INT_ARRAY_JSON = "[1,2,-2000,1000000,-999999999]" ;
61
+ private final static int [] INT_ARRAY = new int [] {1 ,2 ,-2000 ,1000000 ,-999999999 };
62
+
60
63
@ Test
61
- public void testIntArray () throws Exception {
62
- final int [] input = new int []{1 , 2 , 3 , 25 , 999 };
63
- String json = JSON .std .asString (input );
64
- int [] result = JSON .std .beanFrom (int [].class , json );
65
- assertArrayEquals (input , result );
64
+ public void testIntArrayRead () throws Exception {
65
+ assertArrayEquals (INT_ARRAY , JSON .std .beanFrom (int [].class , INT_ARRAY_JSON ));
66
66
}
67
67
68
68
@ Test
69
- public void testLongArray () throws Exception {
70
- final long [] input = new long []{1L , 2L , 3L , 999999999999L , -999999999999L };
71
- String json = JSON .std .asString (input );
72
- long [] result = JSON .std .beanFrom (long [].class , json );
73
- assertArrayEquals (input , result );
69
+ public void testIntArrayWrite () throws Exception {
70
+ assertEquals (INT_ARRAY_JSON , JSON .std .asString (INT_ARRAY ));
71
+ }
72
+
73
+ private final static String LONG_ARRAY_JSON = "[1,-2,3,999999999999,-999999999999]" ;
74
+ private final static long [] LONG_ARRAY = new long [] {1L ,-2L ,3L ,999999999999L ,-999999999999L };
75
+
76
+ @ Test
77
+ public void testLongArrayRead () throws Exception {
78
+ assertArrayEquals (LONG_ARRAY , JSON .std .beanFrom (long [].class , LONG_ARRAY_JSON ));
79
+ }
80
+
81
+ @ Test
82
+ public void testLongArrayWrite () throws Exception {
83
+ assertEquals (LONG_ARRAY_JSON , JSON .std .asString (LONG_ARRAY ));
74
84
}
75
85
76
86
@ Test
0 commit comments