View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.continuum.reports.surefire;
20  
21  import java.util.LinkedList;
22  import java.util.List;
23  
24  /**
25   * @author <a href="mailto:olamy@apache.org">olamy</a>
26   * @version $Id: ReportTestResult.java 729433 2008-12-25 19:06:08Z olamy $
27   * @since 13 nov. 07
28   */
29  public class ReportTestResult
30  {
31  
32      private int testCount = 0;
33  
34      private int failureCount = 0;
35  
36      private int errorCount = 0;
37  
38      private float totalTime = 0;
39  
40      private List<ReportTestSuite> suiteResults;
41  
42      public void addReportTestSuite( ReportTestSuite reportTestSuite )
43      {
44          if ( this.suiteResults == null )
45          {
46              this.suiteResults = new LinkedList<ReportTestSuite>();
47          }
48          this.suiteResults.add( reportTestSuite );
49          this.testCount += reportTestSuite.getNumberOfTests();
50          this.failureCount += reportTestSuite.getNumberOfFailures();
51          this.errorCount += reportTestSuite.getNumberOfErrors();
52          this.totalTime += reportTestSuite.getTimeElapsed();
53      }
54  
55  
56      public int getTestCount()
57      {
58          return testCount;
59      }
60  
61      public void setTestCount( int testCount )
62      {
63          this.testCount = testCount;
64      }
65  
66      public int getFailureCount()
67      {
68          return failureCount;
69      }
70  
71      public void setFailureCount( int failureCount )
72      {
73          this.failureCount = failureCount;
74      }
75  
76      public int getErrorCount()
77      {
78          return errorCount;
79      }
80  
81      public void setErrorCount( int errorCount )
82      {
83          this.errorCount = errorCount;
84      }
85  
86      public List<ReportTestSuite> getSuiteResults()
87      {
88          return suiteResults;
89      }
90  
91      public void setSuiteResults( List<ReportTestSuite> suiteResults )
92      {
93          this.suiteResults = suiteResults;
94      }
95  
96      public float getTotalTime()
97      {
98          return totalTime;
99      }
100 
101     public void setTotalTime( float totalTime )
102     {
103         this.totalTime = totalTime;
104     }
105 
106 }