Added a test to verify that the match algorithm considers availability (both per project class and "total availability")and "project class" when sorting matches according to relevance.

This commit is contained in:
Tom Vahlman 2012-03-02 10:05:27 +01:00
parent 0595121bc9
commit 900b06228d

@ -468,12 +468,12 @@ public class TestGreedyMatchingAlgorithm {
}
// We now perform three tests to verify the correctness of the method GreedyMatchingAlgorithm # Pair # compareTo,
// We now perform 4 tests to verify the correctness of the method GreedyMatchingAlgorithm # Pair # compareTo,
// which sorts the list of matches, i. e. Pairs according to specific criterias
@Test
@Transactional
@Rollback
/* 1.
/* Test 1.
* ==================================================================================
*
* Prerequisites: two supervisors are matched against one bachelor project idea,
@ -516,7 +516,7 @@ public class TestGreedyMatchingAlgorithm {
@Transactional
@Rollback
/* .
* 2.
* Test 2.
* ==================================================================================
* Prerequisites: two supervisors are matched against one bachelor project idea,
* both supervisors have the SAME "total availability" (9)
@ -556,7 +556,7 @@ public class TestGreedyMatchingAlgorithm {
@Test
@Transactional
@Rollback
/* 3.
/* Test 3.
* ==================================================================================
* Prerequisites: two supervisors are matched against one bachelor project idea,
* both supervisors have "open" availability slots for both master and bachelor projects
@ -596,11 +596,11 @@ public class TestGreedyMatchingAlgorithm {
@Test
@Transactional
@Rollback
/* three supervisors are matched against three project ideas
* tests that project classes are regarded when matching project ideas and supervisors
* when available slots are exactly the same
* this test, which may be a duplicate, is done only to test if the matching algorithm can handle a more "complicated" match
* */
/* Test 4
* =============================================================================================
* The test verifies that project classes are regarded when sorting matched Pairs (containing a project idea and a supervisor)
* The test also verifies that the matching algorithm can handle more "complicated" match situations.
* */
public void testThreeSupervisorsAndThreeProjectIdeas_Available_Slots_Are_The_Same() {
List<ProjectIdea> projectIdeaList = new ArrayList<ProjectIdea>();
List<Employee> supervisorList = new ArrayList<Employee>();