@@ -93,62 +93,62 @@ public void badObject() {
93
93
*/
94
94
@ Test
95
95
public void verifyConstructor () {
96
-
97
- final JSONArray expected = new JSONArray ("[10]" );
98
-
99
- @ SuppressWarnings ("rawtypes" )
100
- Collection myRawC = Collections .singleton (Integer .valueOf (10 ));
101
- JSONArray jaRaw = new JSONArray (myRawC );
102
-
103
- Collection <Integer > myCInt = Collections .singleton (Integer .valueOf (10 ));
104
- JSONArray jaInt = new JSONArray (myCInt );
105
-
106
- Collection <Object > myCObj = Collections .singleton ((Object ) Integer
107
- .valueOf (10 ));
108
- JSONArray jaObj = new JSONArray (myCObj );
109
-
110
- assertTrue (
111
- "The RAW Collection should give me the same as the Typed Collection" ,
112
- expected .similar (jaRaw ));
113
- assertTrue (
114
- "The RAW Collection should give me the same as the Typed Collection" ,
115
- expected .similar (jaInt ));
116
- assertTrue (
117
- "The RAW Collection should give me the same as the Typed Collection" ,
118
- expected .similar (jaObj ));
96
+
97
+ final JSONArray expected = new JSONArray ("[10]" );
98
+
99
+ @ SuppressWarnings ("rawtypes" )
100
+ Collection myRawC = Collections .singleton (Integer .valueOf (10 ));
101
+ JSONArray jaRaw = new JSONArray (myRawC );
102
+
103
+ Collection <Integer > myCInt = Collections .singleton (Integer .valueOf (10 ));
104
+ JSONArray jaInt = new JSONArray (myCInt );
105
+
106
+ Collection <Object > myCObj = Collections .singleton ((Object ) Integer
107
+ .valueOf (10 ));
108
+ JSONArray jaObj = new JSONArray (myCObj );
109
+
110
+ assertTrue (
111
+ "The RAW Collection should give me the same as the Typed Collection" ,
112
+ expected .similar (jaRaw ));
113
+ assertTrue (
114
+ "The RAW Collection should give me the same as the Typed Collection" ,
115
+ expected .similar (jaInt ));
116
+ assertTrue (
117
+ "The RAW Collection should give me the same as the Typed Collection" ,
118
+ expected .similar (jaObj ));
119
119
}
120
120
121
121
/**
122
122
* Verifies that the put Collection has backwards compatability with RAW types pre-java5.
123
123
*/
124
124
@ Test
125
125
public void verifyPutCollection () {
126
-
127
- final JSONArray expected = new JSONArray ("[[10]]" );
128
-
129
- @ SuppressWarnings ("rawtypes" )
130
- Collection myRawC = Collections .singleton (Integer .valueOf (10 ));
131
- JSONArray jaRaw = new JSONArray ();
132
- jaRaw .put (myRawC );
133
-
134
- Collection <Object > myCObj = Collections .singleton ((Object ) Integer
135
- .valueOf (10 ));
136
- JSONArray jaObj = new JSONArray ();
137
- jaObj .put (myCObj );
138
-
139
- Collection <Integer > myCInt = Collections .singleton (Integer .valueOf (10 ));
140
- JSONArray jaInt = new JSONArray ();
141
- jaInt .put (myCInt );
142
-
143
- assertTrue (
144
- "The RAW Collection should give me the same as the Typed Collection" ,
145
- expected .similar (jaRaw ));
146
- assertTrue (
147
- "The RAW Collection should give me the same as the Typed Collection" ,
148
- expected .similar (jaObj ));
149
- assertTrue (
150
- "The RAW Collection should give me the same as the Typed Collection" ,
151
- expected .similar (jaInt ));
126
+
127
+ final JSONArray expected = new JSONArray ("[[10]]" );
128
+
129
+ @ SuppressWarnings ("rawtypes" )
130
+ Collection myRawC = Collections .singleton (Integer .valueOf (10 ));
131
+ JSONArray jaRaw = new JSONArray ();
132
+ jaRaw .put (myRawC );
133
+
134
+ Collection <Object > myCObj = Collections .singleton ((Object ) Integer
135
+ .valueOf (10 ));
136
+ JSONArray jaObj = new JSONArray ();
137
+ jaObj .put (myCObj );
138
+
139
+ Collection <Integer > myCInt = Collections .singleton (Integer .valueOf (10 ));
140
+ JSONArray jaInt = new JSONArray ();
141
+ jaInt .put (myCInt );
142
+
143
+ assertTrue (
144
+ "The RAW Collection should give me the same as the Typed Collection" ,
145
+ expected .similar (jaRaw ));
146
+ assertTrue (
147
+ "The RAW Collection should give me the same as the Typed Collection" ,
148
+ expected .similar (jaObj ));
149
+ assertTrue (
150
+ "The RAW Collection should give me the same as the Typed Collection" ,
151
+ expected .similar (jaInt ));
152
152
}
153
153
154
154
@@ -157,41 +157,41 @@ public void verifyPutCollection() {
157
157
*/
158
158
@ Test
159
159
public void verifyPutMap () {
160
-
161
- final JSONArray expected = new JSONArray ("[{\" myKey\" :10}]" );
162
-
163
- @ SuppressWarnings ("rawtypes" )
164
- Map myRawC = Collections .singletonMap ("myKey" , Integer .valueOf (10 ));
165
- JSONArray jaRaw = new JSONArray ();
166
- jaRaw .put (myRawC );
167
-
168
- Map <String , Object > myCStrObj = Collections .singletonMap ("myKey" ,
169
- (Object ) Integer .valueOf (10 ));
170
- JSONArray jaStrObj = new JSONArray ();
171
- jaStrObj .put (myCStrObj );
172
-
173
- Map <String , Integer > myCStrInt = Collections .singletonMap ("myKey" ,
174
- Integer .valueOf (10 ));
175
- JSONArray jaStrInt = new JSONArray ();
176
- jaStrInt .put (myCStrInt );
177
-
178
- Map <?, ?> myCObjObj = Collections .singletonMap ((Object ) "myKey" ,
179
- (Object ) Integer .valueOf (10 ));
180
- JSONArray jaObjObj = new JSONArray ();
181
- jaObjObj .put (myCObjObj );
182
-
183
- assertTrue (
184
- "The RAW Collection should give me the same as the Typed Collection" ,
185
- expected .similar (jaRaw ));
186
- assertTrue (
187
- "The RAW Collection should give me the same as the Typed Collection" ,
188
- expected .similar (jaStrObj ));
189
- assertTrue (
190
- "The RAW Collection should give me the same as the Typed Collection" ,
191
- expected .similar (jaStrInt ));
192
- assertTrue (
193
- "The RAW Collection should give me the same as the Typed Collection" ,
194
- expected .similar (jaObjObj ));
160
+
161
+ final JSONArray expected = new JSONArray ("[{\" myKey\" :10}]" );
162
+
163
+ @ SuppressWarnings ("rawtypes" )
164
+ Map myRawC = Collections .singletonMap ("myKey" , Integer .valueOf (10 ));
165
+ JSONArray jaRaw = new JSONArray ();
166
+ jaRaw .put (myRawC );
167
+
168
+ Map <String , Object > myCStrObj = Collections .singletonMap ("myKey" ,
169
+ (Object ) Integer .valueOf (10 ));
170
+ JSONArray jaStrObj = new JSONArray ();
171
+ jaStrObj .put (myCStrObj );
172
+
173
+ Map <String , Integer > myCStrInt = Collections .singletonMap ("myKey" ,
174
+ Integer .valueOf (10 ));
175
+ JSONArray jaStrInt = new JSONArray ();
176
+ jaStrInt .put (myCStrInt );
177
+
178
+ Map <?, ?> myCObjObj = Collections .singletonMap ((Object ) "myKey" ,
179
+ (Object ) Integer .valueOf (10 ));
180
+ JSONArray jaObjObj = new JSONArray ();
181
+ jaObjObj .put (myCObjObj );
182
+
183
+ assertTrue (
184
+ "The RAW Collection should give me the same as the Typed Collection" ,
185
+ expected .similar (jaRaw ));
186
+ assertTrue (
187
+ "The RAW Collection should give me the same as the Typed Collection" ,
188
+ expected .similar (jaStrObj ));
189
+ assertTrue (
190
+ "The RAW Collection should give me the same as the Typed Collection" ,
191
+ expected .similar (jaStrInt ));
192
+ assertTrue (
193
+ "The RAW Collection should give me the same as the Typed Collection" ,
194
+ expected .similar (jaObjObj ));
195
195
}
196
196
197
197
/**
0 commit comments