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