1 package org.apache.maven.plugin.surefire.runorder;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public class Priority
26 {
27 private final String className;
28
29 int priority;
30
31 int totalRuntime = 0;
32
33 int minSuccessRate = Integer.MAX_VALUE;
34
35 public Priority( String className )
36 {
37 this.className = className;
38 }
39
40
41
42
43
44
45
46 public static Priority newTestClassPriority( String className )
47 {
48 Priority priority1 = new Priority( className );
49 priority1.setPriority( 0 );
50 priority1.minSuccessRate = 0;
51 return priority1;
52 }
53
54 public void addItem( RunEntryStatistics itemStat )
55 {
56 totalRuntime += itemStat.getRunTime();
57 minSuccessRate = Math.min( minSuccessRate, itemStat.getSuccessfulBuilds() );
58 }
59
60
61 public int getTotalRuntime()
62 {
63 return totalRuntime;
64 }
65
66 public int getMinSuccessRate()
67 {
68 return minSuccessRate;
69 }
70
71 public String getClassName()
72 {
73 return className;
74 }
75
76 public int getPriority()
77 {
78 return priority;
79 }
80
81 public void setPriority( int priority )
82 {
83 this.priority = priority;
84 }
85 }