1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.continuum.reports.surefire;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24
25
26
27
28
29 public class ReportTest
30 {
31 private String id;
32
33 private String name;
34
35 private int tests;
36
37 private int errors;
38
39 private int failures;
40
41 private float elapsedTime;
42
43 private List children;
44
45 public String getName()
46 {
47 return name;
48 }
49
50 public void setName( String name )
51 {
52 this.name = name;
53 }
54
55 public int getTests()
56 {
57 return tests;
58 }
59
60 public void setTests( int tests )
61 {
62 this.tests = tests;
63 }
64
65 public int getErrors()
66 {
67 return errors;
68 }
69
70 public void setErrors( int errors )
71 {
72 this.errors = errors;
73 }
74
75 public int getFailures()
76 {
77 return failures;
78 }
79
80 public void setFailures( int failures )
81 {
82 this.failures = failures;
83 }
84
85 public float getSuccessRate()
86 {
87 float percentage;
88 if ( tests == 0 )
89 {
90 percentage = 0;
91 }
92 else
93 {
94 percentage = ( (float) ( tests - errors - failures ) / (float) tests ) * 100;
95 }
96
97 return percentage;
98 }
99
100 public float getElapsedTime()
101 {
102 return elapsedTime;
103 }
104
105 public void setElapsedTime( float elapsedTime )
106 {
107 this.elapsedTime = elapsedTime;
108 }
109
110 public List getChildren()
111 {
112 if ( children == null )
113 {
114 children = new ArrayList();
115 }
116
117 return children;
118 }
119
120 public void setChildren( List children )
121 {
122 this.children = children;
123 }
124
125 public String getId()
126 {
127 return id;
128 }
129
130 public void setId( String id )
131 {
132 this.id = id;
133 }
134 }