Decomposition decomposition3 = createDecomposition(gss, subgoal3, goal2);
Decomposition decomposition4 = createDecomposition(gss, subgoal4, goal2);
PrioritizedDecomposition priorizedDecomposition3 = createPriorizedDecomposition(gssQuery, decomposition3, 50);
PrioritizedDecomposition priorizedDecomposition4 = createPriorizedDecomposition(gssQuery, decomposition4, 50);
PrioritizedElement selectedGoal1 = createSelectedGoal(gssQuery, goal1, 50);
PrioritizedElement selectedGoal2 = createSelectedGoal(gssQuery, goal2, 50);
Decomposition decomposition5 = createDecomposition(gss, subgoal5, subgoal3);
Decomposition decomposition6 = createDecomposition(gss, subgoal6, subgoal3);
PrioritizedDecomposition priorizedDecomposition5 = createPriorizedDecomposition(gssQuery, decomposition5, 40);
PrioritizedDecomposition priorizedDecomposition6 = createPriorizedDecomposition(gssQuery, decomposition6, 60);
createSelectedGoal(gssQuery, subgoal1, 25);
createSelectedGoal(gssQuery, subgoal2, 25);
createSelectedGoal(gssQuery, subgoal3, 25);
createSelectedGoal(gssQuery, subgoal4, 25);
createSelectedGoal(gssQuery, subgoal5, 10);
createSelectedGoal(gssQuery, subgoal6, 15);
executeRequiredPhases();
priorizedElementsCache.setPriority(goal1, 80);
priorizedElementsCache.setPriority(goal2, 20);
assertEquals(80.0f , priorizedElementsCache.getPrioritizedElementPriority(goal1));
assertEquals(20.0f , priorizedElementsCache.getPrioritizedElementPriority(goal2));
assertEquals("50", selectedGoal1.getGlobalPriority()); //priority of elements in the emf workspace must be unchanged until flush() is called
assertEquals("50", selectedGoal2.getGlobalPriority());
assertEquals(new Integer(50) , priorizedElementsCache.getWeight(subgoal1, goal1));
assertEquals(new Integer(50) , priorizedElementsCache.getWeight(subgoal2, goal1));
assertEquals(40.0f , priorizedElementsCache.getPrioritizedElementPriority(subgoal1));