1
1
/*
2
- * Copyright (c) 2011 by the original author(s) .
2
+ * Copyright 2011-2012 the original author or authors .
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
6
6
* You may obtain a copy of the License at
7
7
*
8
- * http://www.apache.org/licenses/LICENSE-2.0
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
9
*
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
33
33
import com .mongodb .DBObject ;
34
34
35
35
/**
36
- * Unit test to reproduce DATADOC -273.
36
+ * Unit test to reproduce DATAMONGO -273.
37
37
*
38
38
* @author Harlan Iverson
39
+ * @author Oliver Gierke
39
40
*/
40
- public class DataDoc273Test {
41
+ public class DataMongo273Tests {
41
42
42
43
MappingMongoConverter converter ;
43
44
@@ -54,7 +55,7 @@ public void setupMongoConv() {
54
55
}
55
56
56
57
/**
57
- * @see DATADOC -273
58
+ * @see DATAMONGO -273
58
59
*/
59
60
@ Test
60
61
public void convertMapOfThings () {
@@ -80,7 +81,7 @@ public void convertMapOfThings() {
80
81
}
81
82
82
83
/**
83
- * @see DATADOC -294
84
+ * @see DATAMONGO -294
84
85
*/
85
86
@ Test
86
87
@ SuppressWarnings ({ "rawtypes" , "unchecked" })
@@ -96,7 +97,6 @@ public void convertListOfThings() {
96
97
97
98
DBObject result = new BasicDBList ();
98
99
converter .write (listOfThings , result );
99
- System .out .println (result .toString ());
100
100
101
101
List listOfThings2 = converter .read (List .class , result );
102
102
@@ -106,7 +106,7 @@ public void convertListOfThings() {
106
106
}
107
107
108
108
/**
109
- * @see DATADOC -294
109
+ * @see DATAMONGO -294
110
110
*/
111
111
@ Test
112
112
@ SuppressWarnings ({ "rawtypes" , "unchecked" })
@@ -121,7 +121,7 @@ public void convertListOfThings_NestedInMap() {
121
121
listOfThings .add (train );
122
122
listOfThings .add (automobile );
123
123
124
- Map box = new HashMap ();
124
+ Map < String , Object > box = new HashMap < String , Object > ();
125
125
box .put ("one" , listOfThings );
126
126
127
127
Shipment shipment = new Shipment (box );
@@ -138,7 +138,7 @@ public void convertListOfThings_NestedInMap() {
138
138
assertTrue (listOfThings2 .get (2 ) instanceof Automobile );
139
139
}
140
140
141
- class Plane {
141
+ static class Plane {
142
142
143
143
String maker ;
144
144
int numberOfPropellers ;
@@ -149,7 +149,7 @@ public Plane(String maker, int numberOfPropellers) {
149
149
}
150
150
}
151
151
152
- class Train {
152
+ static class Train {
153
153
154
154
String railLine ;
155
155
int numberOfCars ;
@@ -160,7 +160,7 @@ public Train(String railLine, int numberOfCars) {
160
160
}
161
161
}
162
162
163
- class Automobile {
163
+ static class Automobile {
164
164
165
165
String make ;
166
166
String model ;
@@ -174,11 +174,11 @@ public Automobile(String make, String model, int numberOfDoors) {
174
174
}
175
175
176
176
@ SuppressWarnings ("rawtypes" )
177
- public class Shipment {
177
+ static class Shipment {
178
178
179
- Map boxes = new HashMap () ;
179
+ Map < String , Object > boxes ;
180
180
181
- public Shipment (Map boxes ) {
181
+ public Shipment (Map < String , Object > boxes ) {
182
182
this .boxes = boxes ;
183
183
}
184
184
0 commit comments