A comparison should be based on equals and not the "=="-operator.

This commit is contained in:
Tom Vahlman 2012-02-11 16:17:02 +01:00
parent 29d42cdb2d
commit 96a16a4c6a

@ -61,7 +61,7 @@ public class TestGreedyMatchingAlgorithm {
private Set<Language> languages;
@Before
public void startTransaction() throws Exception {
public void init() throws Exception {
unmatchedProjectIdeas = new ArrayList<ProjectIdea>();
supervisorAvailability = new ArrayList<Availability>();
languages = new HashSet<Language>();
@ -120,10 +120,7 @@ public class TestGreedyMatchingAlgorithm {
GreedyMatchingAlgorithm matchAlgorithm = new GreedyMatchingAlgorithm();
Result result = matchAlgorithm.match(supervisorAvailability, unmatchedProjectIdeas, weights);
Assert.isTrue(result.matches.get(0).getProjectIdea() == masterProjectIdea);
Assert.isTrue(result.matches.get(0).getProjectIdea().equals(masterProjectIdea));
Assert.isTrue(result.matches.get(0).getSupervisor() == masterSupervisor);
Assert.notEmpty(result.matches);
Assert.isTrue(result.unmatched.size() == 0);
}
@ -138,7 +135,6 @@ public class TestGreedyMatchingAlgorithm {
GreedyMatchingAlgorithm matchAlgorithm = new GreedyMatchingAlgorithm();
Result result = matchAlgorithm.match(supervisorAvailability, unmatchedProjectIdeas, weights);
Assert.notEmpty(result.matches);
Assert.isTrue(result.matches.get(0).getProjectIdea().equals(bachelorProjectIdea));
Assert.isTrue(result.matches.get(0).getSupervisor().equals(masterSupervisor));