1 package org.apache.maven.plugins.surefire.report;
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 public class ReportTestSuite
29 {
30 private List<ReportTestCase> testCases = new ArrayList<ReportTestCase>();
31
32 private int numberOfErrors;
33
34 private int numberOfFailures;
35
36 private int numberOfSkipped;
37
38 private Integer numberOfTests;
39
40 private String name;
41
42 private String fullClassName;
43
44 private String packageName;
45
46 private float timeElapsed;
47
48 public List<ReportTestCase> getTestCases()
49 {
50 return this.testCases;
51 }
52
53 public int getNumberOfErrors()
54 {
55 return numberOfErrors;
56 }
57
58 public void setNumberOfErrors( int numberOfErrors )
59 {
60 this.numberOfErrors = numberOfErrors;
61 }
62
63 public int getNumberOfFailures()
64 {
65 return numberOfFailures;
66 }
67
68 public void setNumberOfFailures( int numberOfFailures )
69 {
70 this.numberOfFailures = numberOfFailures;
71 }
72
73 public int getNumberOfSkipped()
74 {
75 return numberOfSkipped;
76 }
77
78 public void setNumberOfSkipped( int numberOfSkipped )
79 {
80 this.numberOfSkipped = numberOfSkipped;
81 }
82
83 public int getNumberOfTests()
84 {
85 if ( numberOfTests != null )
86 {
87 return numberOfTests;
88 }
89 if ( testCases != null )
90 {
91 return testCases.size();
92 }
93 return 0;
94 }
95
96 public void setNumberOfTests( int numberOfTests )
97 {
98 this.numberOfTests = numberOfTests;
99 }
100
101 public String getName()
102 {
103 return name;
104 }
105
106 public void setName( String name )
107 {
108 this.name = name;
109 }
110
111 public String getFullClassName()
112 {
113 return fullClassName;
114 }
115
116 public void setFullClassName( String fullClassName )
117 {
118 this.fullClassName = fullClassName;
119 int lastDotPosition = fullClassName.lastIndexOf( "." );
120
121 name = fullClassName.substring( lastDotPosition + 1, fullClassName.length() );
122
123 if ( lastDotPosition < 0 )
124 {
125
126 packageName = "";
127 }
128 else
129 {
130 packageName = fullClassName.substring( 0, lastDotPosition );
131 }
132 }
133
134 public String getPackageName()
135 {
136 return packageName;
137 }
138
139 public void setPackageName( String packageName )
140 {
141 this.packageName = packageName;
142 }
143
144 public float getTimeElapsed()
145 {
146 return this.timeElapsed;
147 }
148
149 public void setTimeElapsed( float timeElapsed )
150 {
151 this.timeElapsed = timeElapsed;
152 }
153
154 public void setTestCases( List<ReportTestCase> testCases )
155 {
156 this.testCases = testCases;
157 }
158
159
160
161
162 public String toString()
163 {
164 return fullClassName + " [" + getNumberOfTests() + "/" + getNumberOfFailures() + "/" + getNumberOfErrors() + "/"
165 + getNumberOfSkipped() + "]";
166 }
167 }