|
|
@@ -118,7 +118,7 @@ public class CargoTest extends TestCase {
|
|
118
|
118
|
// Adding an event unrelated to unloading at final destination
|
|
119
|
119
|
events.add(
|
|
120
|
120
|
new HandlingEvent(cargo, new Date(10), new Date(), HandlingEvent.Type.RECEIVE, HANGZOU));
|
|
121
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
121
|
+ cargo.deriveDeliveryProgress(events);
|
|
122
|
122
|
assertFalse(cargo.isUnloadedAtDestination());
|
|
123
|
123
|
|
|
124
|
124
|
Voyage voyage = new Voyage.Builder(new VoyageNumber("0123"), HANGZOU).
|
|
|
@@ -128,19 +128,19 @@ public class CargoTest extends TestCase {
|
|
128
|
128
|
// Adding an unload event, but not at the final destination
|
|
129
|
129
|
events.add(
|
|
130
|
130
|
new HandlingEvent(cargo, new Date(20), new Date(), HandlingEvent.Type.UNLOAD, TOKYO, voyage));
|
|
131
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
131
|
+ cargo.deriveDeliveryProgress(events);
|
|
132
|
132
|
assertFalse(cargo.isUnloadedAtDestination());
|
|
133
|
133
|
|
|
134
|
134
|
// Adding an event in the final destination, but not unload
|
|
135
|
135
|
events.add(
|
|
136
|
136
|
new HandlingEvent(cargo, new Date(30), new Date(), HandlingEvent.Type.CUSTOMS, NEWYORK));
|
|
137
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
137
|
+ cargo.deriveDeliveryProgress(events);
|
|
138
|
138
|
assertFalse(cargo.isUnloadedAtDestination());
|
|
139
|
139
|
|
|
140
|
140
|
// Finally, cargo is unloaded at final destination
|
|
141
|
141
|
events.add(
|
|
142
|
142
|
new HandlingEvent(cargo, new Date(40), new Date(), HandlingEvent.Type.UNLOAD, NEWYORK, voyage));
|
|
143
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
143
|
+ cargo.deriveDeliveryProgress(events);
|
|
144
|
144
|
assertTrue(cargo.isUnloadedAtDestination());
|
|
145
|
145
|
}
|
|
146
|
146
|
|
|
|
@@ -150,7 +150,7 @@ public class CargoTest extends TestCase {
|
|
150
|
150
|
|
|
151
|
151
|
HandlingEvent he = new HandlingEvent(cargo, getDate("2007-12-01"), new Date(), HandlingEvent.Type.RECEIVE, STOCKHOLM);
|
|
152
|
152
|
events.add(he);
|
|
153
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
153
|
+ cargo.deriveDeliveryProgress(events);
|
|
154
|
154
|
|
|
155
|
155
|
return cargo;
|
|
156
|
156
|
}
|
|
|
@@ -159,7 +159,7 @@ public class CargoTest extends TestCase {
|
|
159
|
159
|
final Cargo cargo = populateCargoOffMelbourne();
|
|
160
|
160
|
|
|
161
|
161
|
events.add(new HandlingEvent(cargo, getDate("2007-12-09"), new Date(), HandlingEvent.Type.CLAIM, MELBOURNE));
|
|
162
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
162
|
+ cargo.deriveDeliveryProgress(events);
|
|
163
|
163
|
|
|
164
|
164
|
return cargo;
|
|
165
|
165
|
}
|
|
|
@@ -174,7 +174,7 @@ public class CargoTest extends TestCase {
|
|
174
|
174
|
events.add(new HandlingEvent(cargo, getDate("2007-12-03"), new Date(), HandlingEvent.Type.LOAD, HAMBURG, voyage));
|
|
175
|
175
|
events.add(new HandlingEvent(cargo, getDate("2007-12-04"), new Date(), HandlingEvent.Type.UNLOAD, HONGKONG, voyage));
|
|
176
|
176
|
|
|
177
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
177
|
+ cargo.deriveDeliveryProgress(events);
|
|
178
|
178
|
return cargo;
|
|
179
|
179
|
}
|
|
180
|
180
|
|
|
|
@@ -185,7 +185,7 @@ public class CargoTest extends TestCase {
|
|
185
|
185
|
events.add(new HandlingEvent(cargo, getDate("2007-12-02"), new Date(), HandlingEvent.Type.UNLOAD, HAMBURG, voyage));
|
|
186
|
186
|
events.add(new HandlingEvent(cargo, getDate("2007-12-03"), new Date(), HandlingEvent.Type.LOAD, HAMBURG, voyage));
|
|
187
|
187
|
|
|
188
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
188
|
+ cargo.deriveDeliveryProgress(events);
|
|
189
|
189
|
return cargo;
|
|
190
|
190
|
}
|
|
191
|
191
|
|
|
|
@@ -201,7 +201,7 @@ public class CargoTest extends TestCase {
|
|
201
|
201
|
events.add(new HandlingEvent(cargo, getDate("2007-12-05"), new Date(), HandlingEvent.Type.LOAD, HONGKONG, voyage));
|
|
202
|
202
|
events.add(new HandlingEvent(cargo, getDate("2007-12-07"), new Date(), HandlingEvent.Type.UNLOAD, MELBOURNE, voyage));
|
|
203
|
203
|
|
|
204
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
204
|
+ cargo.deriveDeliveryProgress(events);
|
|
205
|
205
|
return cargo;
|
|
206
|
206
|
}
|
|
207
|
207
|
|
|
|
@@ -216,7 +216,7 @@ public class CargoTest extends TestCase {
|
|
216
|
216
|
|
|
217
|
217
|
events.add(new HandlingEvent(cargo, getDate("2007-12-05"), new Date(), HandlingEvent.Type.LOAD, HONGKONG, voyage));
|
|
218
|
218
|
|
|
219
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
219
|
+ cargo.deriveDeliveryProgress(events);
|
|
220
|
220
|
return cargo;
|
|
221
|
221
|
}
|
|
222
|
222
|
|
|
|
@@ -242,7 +242,7 @@ public class CargoTest extends TestCase {
|
|
242
|
242
|
handlingEvents.add(new HandlingEvent(cargo, new Date(130), new Date(140), HandlingEvent.Type.CUSTOMS, GOTHENBURG));
|
|
243
|
243
|
|
|
244
|
244
|
events.addAll(handlingEvents);
|
|
245
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
245
|
+ cargo.deriveDeliveryProgress(events);
|
|
246
|
246
|
assertFalse(cargo.isMisdirected());
|
|
247
|
247
|
|
|
248
|
248
|
//Try a couple of failing ones
|
|
|
@@ -252,7 +252,7 @@ public class CargoTest extends TestCase {
|
|
252
|
252
|
|
|
253
|
253
|
handlingEvents.add(new HandlingEvent(cargo, new Date(), new Date(), HandlingEvent.Type.RECEIVE, HANGZOU));
|
|
254
|
254
|
events.addAll(handlingEvents);
|
|
255
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
255
|
+ cargo.deriveDeliveryProgress(events);
|
|
256
|
256
|
|
|
257
|
257
|
assertTrue(cargo.isMisdirected());
|
|
258
|
258
|
|
|
|
@@ -266,7 +266,7 @@ public class CargoTest extends TestCase {
|
|
266
|
266
|
handlingEvents.add(new HandlingEvent(cargo, new Date(70), new Date(80), HandlingEvent.Type.LOAD, ROTTERDAM, voyage));
|
|
267
|
267
|
|
|
268
|
268
|
events.addAll(handlingEvents);
|
|
269
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
269
|
+ cargo.deriveDeliveryProgress(events);
|
|
270
|
270
|
|
|
271
|
271
|
assertTrue(cargo.isMisdirected());
|
|
272
|
272
|
|
|
|
@@ -280,7 +280,7 @@ public class CargoTest extends TestCase {
|
|
280
|
280
|
handlingEvents.add(new HandlingEvent(cargo, new Date(), new Date(), HandlingEvent.Type.CLAIM, ROTTERDAM));
|
|
281
|
281
|
|
|
282
|
282
|
events.addAll(handlingEvents);
|
|
283
|
|
- cargo.deriveStatusFromHandling(events);
|
|
|
283
|
+ cargo.deriveDeliveryProgress(events);
|
|
284
|
284
|
|
|
285
|
285
|
assertTrue(cargo.isMisdirected());
|
|
286
|
286
|
}
|