1
1
package com .thealgorithms .scheduling ;
2
2
3
- import com .thealgorithms .devutils .entities .ProcessDetails ;
4
- import org .junit .jupiter .api .Test ;
3
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
5
4
5
+ import com .thealgorithms .devutils .entities .ProcessDetails ;
6
6
import java .util .ArrayList ;
7
7
import java .util .List ;
8
-
9
- import static org .junit .jupiter .api .Assertions .assertEquals ;
8
+ import org .junit .jupiter .api .Test ;
10
9
11
10
/**
12
11
* Test Cases of Preemptive Priority Scheduling Algorithm
@@ -26,9 +25,7 @@ void testPreemptivePriorityScheduling() {
26
25
PreemptivePriorityScheduling scheduler = new PreemptivePriorityScheduling (processes );
27
26
scheduler .scheduleProcesses ();
28
27
29
- List <String > expectedSchedule = List .of (
30
- "P1" , "P2" , "P3" , "P3" , "P4" , "P2" , "P2" , "P2" , "P1" , "P1" , "P1" , "P1"
31
- );
28
+ List <String > expectedSchedule = List .of ("P1" , "P2" , "P3" , "P3" , "P4" , "P2" , "P2" , "P2" , "P1" , "P1" , "P1" , "P1" );
32
29
33
30
assertEquals (expectedSchedule , scheduler .ganttChart );
34
31
}
@@ -43,9 +40,7 @@ void testPreemptivePrioritySchedulingWithIdleTime() {
43
40
PreemptivePriorityScheduling scheduler = new PreemptivePriorityScheduling (processes );
44
41
scheduler .scheduleProcesses ();
45
42
46
- List <String > expectedSchedule = List .of (
47
- "Idle" , "Idle" , "P1" , "P1" , "P1" , "P2" , "P2" , "P3" , "P2" , "P1" , "P1"
48
- );
43
+ List <String > expectedSchedule = List .of ("Idle" , "Idle" , "P1" , "P1" , "P1" , "P2" , "P2" , "P3" , "P2" , "P1" , "P1" );
49
44
50
45
assertEquals (expectedSchedule , scheduler .ganttChart );
51
46
}
0 commit comments