mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
change fleetManager concept - instead of returned available types, it
returns vehicles; adapt CalculatesVehTypeDepServiceInsertion to changes in FleetManager
This commit is contained in:
parent
97faf7fb53
commit
cdf4878bf9
7 changed files with 143 additions and 47 deletions
|
|
@ -60,8 +60,8 @@ public class CalcVehicleTypeDependentServiceInsertionTest {
|
|||
fleetManager = mock(VehicleFleetManager.class);
|
||||
service = mock(Service.class);
|
||||
vehicleRoute = mock(VehicleRoute.class);
|
||||
TypeKey typeKey1 = new TypeKey(veh1.getType(),veh1.getLocationId());
|
||||
TypeKey typeKey2 = new TypeKey(veh2.getType(),veh2.getLocationId());
|
||||
TypeKey typeKey1 = new TypeKey(veh1.getType().getTypeId(),veh1.getLocationId());
|
||||
TypeKey typeKey2 = new TypeKey(veh2.getType().getTypeId(),veh2.getLocationId());
|
||||
when(fleetManager.getAvailableVehicleTypes()).thenReturn(Arrays.asList(typeKey1,typeKey2));
|
||||
when(fleetManager.getEmptyVehicle(typeKey1)).thenReturn(veh1);
|
||||
when(fleetManager.getEmptyVehicle(typeKey2)).thenReturn(veh2);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class TestVehicleFleetManager extends TestCase{
|
|||
}
|
||||
|
||||
public void testGetVehicle(){
|
||||
TypeKey typeKey = new TypeKey(v1.getType(),v1.getLocationId());
|
||||
TypeKey typeKey = new TypeKey(v1.getType().getTypeId(),v1.getLocationId());
|
||||
Vehicle v = fleetManager.getEmptyVehicle(typeKey);
|
||||
assertEquals(v.getId(), v1.getId());
|
||||
}
|
||||
|
|
@ -87,10 +87,10 @@ public class TestVehicleFleetManager extends TestCase{
|
|||
}
|
||||
|
||||
public void testGetTypesWithout(){
|
||||
TypeKey typeKey = new TypeKey(v1.getType(),v1.getLocationId());
|
||||
TypeKey typeKey = new TypeKey(v1.getType().getTypeId(),v1.getLocationId());
|
||||
Collection<TypeKey> types = fleetManager.getAvailableVehicleTypes(typeKey);
|
||||
|
||||
assertEquals(new TypeKey(v2.getType(),v2.getLocationId()), types.iterator().next());
|
||||
assertEquals(new TypeKey(v2.getType().getTypeId(),v2.getLocationId()), types.iterator().next());
|
||||
assertEquals(1, types.size());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue