@@ -0,0 +1,1455 @@
+package jsprit.core.algorithm;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.mock;%0A%0Aimport java.util.Collection;%0A%0Aimport jsprit.core.algorithm.listener.IterationStartsListener;%0Aimport jsprit.core.problem.VehicleRoutingProblem;%0Aimport jsprit.core.problem.solution.VehicleRoutingProblemSolution;%0A%0Aimport org.junit.Test;%0A%0Apublic class VehicleRoutingAlgorithmTest %7B%0A%09%0A%09@Test%0A%09public void whenSettingIterations_itIsSetCorrectly()%7B%0A%09%09VehicleRoutingAlgorithm algorithm = new VehicleRoutingAlgorithm(mock(VehicleRoutingProblem.class),%0A%09%09%09%09mock(SearchStrategyManager.class));%0A%09%09algorithm.setNuOfIterations(50);%0A%09%09assertEquals(50,algorithm.getNuOfIterations());%0A%09%7D%0A%09%0A%09private static class CountIterations implements IterationStartsListener %7B%0A%0A%09%09private int countIterations = 0;%0A%09%09%0A%09%09@Override%0A%09%09public void informIterationStarts(int i, VehicleRoutingProblem problem,Collection%3CVehicleRoutingProblemSolution%3E solutions) %7B%0A%09%09%09countIterations++;%0A%09%09%7D%0A%0A%09%09public int getCountIterations() %7B%0A%09%09%09return countIterations;%0A%09%09%7D%0A%09%09%0A%09%7D%0A%09%0A%09@Test%0A%09public void whenSettingIterations_iterAreExecutedCorrectly()%7B%0A%09%09VehicleRoutingAlgorithm algorithm = new VehicleRoutingAlgorithm(mock(VehicleRoutingProblem.class),%0A%09%09%09%09mock(SearchStrategyManager.class));%0A%09%09algorithm.setNuOfIterations(100);%0A%09%09CountIterations counter = new CountIterations();%0A%09%09algorithm.addListener(counter);%0A%09%09algorithm.searchSolutions();%0A%09%09assertEquals(100,counter.getCountIterations());%0A%09%7D%0A%0A%7D%0A

add test