Objects were not saved in the tests.

This commit is contained in:
Tom Vahlman 2012-02-11 19:33:17 +01:00
parent 6e5fddd656
commit 08be318726

@ -134,7 +134,8 @@ public class TestGreedyMatchingAlgorithm {
Result result = runAlgorithm(masterProjectIdea);
Assert.notEmpty(result.matches);
Assert.isTrue(result.matches.get(0).getProjectIdea().equals(masterProjectIdea));
Assert.isTrue(result.unmatched.size() == 0);
Assert.isTrue(result.matches.get(0).getSupervisor().equals(masterSupervisor));
Assert.isTrue(result.unmatched.size() == 0);
}
@Test
@ -164,6 +165,7 @@ public class TestGreedyMatchingAlgorithm {
@Test
@Transactional
@Rollback
/* no matches are found */
public void testMatchMasterThesisAndBachelorSupervisor() {
setSupervisorAvailability(bachelorSupervisor, bachelorProjectClass);
Result result = runAlgorithm(masterProjectIdea);
@ -175,12 +177,9 @@ public class TestGreedyMatchingAlgorithm {
@Transactional
@Rollback
public void testMatchRightSupervisor() {
Employee bachelorSupervisor2 = new Employee();
bachelorSupervisor2.getCapabilities().setLanguages(languages);
Availability availability1 = new Availability(bachelorSupervisor, 0L, 1, bachelorProjectClass);
Availability availability2 = new Availability(bachelorSupervisor2, 0L, 1, bachelorProjectClass);
supervisorAvailability.add(availability1);
supervisorAvailability.add(availability2);
Employee bachelorSupervisor2 = createSupervisor("David", "Hallberg");
setSupervisorAvailability(bachelorSupervisor, bachelorProjectClass);
setSupervisorAvailability(bachelorSupervisor2, bachelorProjectClass);
bachelorProjectIdea.setPreferredSupervisor(bachelorSupervisor2);
Result result = runAlgorithm(bachelorProjectIdea);