@@ -9,8 +9,7 @@ public class NonPreemptivePrioritySchedulingTest {
9
9
@ Test
10
10
public void testCalculateAverageWaitingTime () {
11
11
NonPreemptivePriorityScheduling .Process [] processes = {new NonPreemptivePriorityScheduling .Process (1 , 0 , 10 , 2 ), // id, arrivalTime, burstTime, priority
12
- new NonPreemptivePriorityScheduling .Process (2 , 0 , 5 , 1 ), new NonPreemptivePriorityScheduling .Process (3 , 0 , 8 , 3 )
13
- };
12
+ new NonPreemptivePriorityScheduling .Process (2 , 0 , 5 , 1 ), new NonPreemptivePriorityScheduling .Process (3 , 0 , 8 , 3 )};
14
13
NonPreemptivePriorityScheduling .Process [] executionOrder = NonPreemptivePriorityScheduling .scheduleProcesses (processes );
15
14
16
15
double expectedAvgWaitingTime = (0 + 5 + 15 ) / 3.0 ; // Waiting times: 0 for P2, 5 for P1, 15 for P3
@@ -22,8 +21,7 @@ public void testCalculateAverageWaitingTime() {
22
21
@ Test
23
22
public void testCalculateAverageTurnaroundTime () {
24
23
NonPreemptivePriorityScheduling .Process [] processes = {new NonPreemptivePriorityScheduling .Process (1 , 0 , 10 , 2 ), // id, arrivalTime, burstTime, priority
25
- new NonPreemptivePriorityScheduling .Process (2 , 0 , 5 , 1 ), new NonPreemptivePriorityScheduling .Process (3 , 0 , 8 , 3 )
26
- };
24
+ new NonPreemptivePriorityScheduling .Process (2 , 0 , 5 , 1 ), new NonPreemptivePriorityScheduling .Process (3 , 0 , 8 , 3 )};
27
25
NonPreemptivePriorityScheduling .Process [] executionOrder = NonPreemptivePriorityScheduling .scheduleProcesses (processes );
28
26
29
27
double expectedAvgTurnaroundTime = (5 + 15 + 23 ) / 3.0 ; // Turnaround times: 5 for P2, 15 for P1, 23 for P3
@@ -35,8 +33,7 @@ public void testCalculateAverageTurnaroundTime() {
35
33
@ Test
36
34
public void testStartTimeIsCorrect () {
37
35
NonPreemptivePriorityScheduling .Process [] processes = {new NonPreemptivePriorityScheduling .Process (1 , 0 , 10 , 2 ), // id, arrivalTime, burstTime, priority
38
- new NonPreemptivePriorityScheduling .Process (2 , 0 , 5 , 1 ), new NonPreemptivePriorityScheduling .Process (3 , 0 , 8 , 3 )
39
- };
36
+ new NonPreemptivePriorityScheduling .Process (2 , 0 , 5 , 1 ), new NonPreemptivePriorityScheduling .Process (3 , 0 , 8 , 3 )};
40
37
NonPreemptivePriorityScheduling .Process [] executionOrder = NonPreemptivePriorityScheduling .scheduleProcesses (processes );
41
38
42
39
// Check that the start time for each process is correctly set
0 commit comments