View Javadoc

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