mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
test VehicleFleetManagers
This commit is contained in:
parent
d41ad158cd
commit
937702e136
3 changed files with 22 additions and 2 deletions
|
|
@ -27,7 +27,6 @@ public class FiniteFleetManagerFactory implements VehicleFleetManagerFactory{
|
|||
|
||||
private Collection<Vehicle> vehicles;
|
||||
|
||||
|
||||
/**
|
||||
* Constucts the factory.
|
||||
*
|
||||
|
|
@ -40,9 +39,14 @@ public class FiniteFleetManagerFactory implements VehicleFleetManagerFactory{
|
|||
|
||||
/**
|
||||
* Creates the finite fleetmanager.
|
||||
*
|
||||
* @return VehicleFleetManager
|
||||
* @throws IllegalStateManager if vehicles == null or vehicles.isEmpty()
|
||||
*/
|
||||
@Override
|
||||
public VehicleFleetManager createFleetManager() {
|
||||
if(vehicles == null) throw new IllegalStateException("vehicles is null. this must not be.");
|
||||
if(vehicles.isEmpty()) throw new IllegalStateException("vehicle-collection is empty. this must not be");
|
||||
return new VehicleFleetManagerImpl(vehicles);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue