View Javadoc
1   package org.apache.maven.plugins.surefire.report;
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 org.apache.maven.shared.utils.StringUtils;
23  
24  /**
25   *
26   */
27  public final class ReportTestCase
28  {
29      private String fullClassName;
30  
31      private String className;
32  
33      private String fullName;
34  
35      private String name;
36  
37      private float time;
38  
39      private String failureMessage;
40  
41      private String failureType;
42  
43      private String failureErrorLine;
44  
45      private String failureDetail;
46  
47      private boolean hasFailure;
48  
49      public String getName()
50      {
51          return name;
52      }
53  
54      public ReportTestCase setName( String name )
55      {
56          this.name = name;
57          return this;
58      }
59  
60      public String getFullClassName()
61      {
62          return fullClassName;
63      }
64  
65      public ReportTestCase setFullClassName( String name )
66      {
67          fullClassName = name;
68          return this;
69      }
70  
71      public String getClassName()
72      {
73          return className;
74      }
75  
76      public ReportTestCase setClassName( String name )
77      {
78          className = name;
79          return this;
80      }
81  
82      public float getTime()
83      {
84          return time;
85      }
86  
87      public ReportTestCase setTime( float time )
88      {
89          this.time = time;
90          return this;
91      }
92  
93      public String getFullName()
94      {
95          return fullName;
96      }
97  
98      public ReportTestCase setFullName( String fullName )
99      {
100         this.fullName = fullName;
101         return this;
102     }
103 
104     public String getFailureMessage()
105     {
106         return failureMessage;
107     }
108 
109     private ReportTestCase setFailureMessage( String failureMessage )
110     {
111         this.failureMessage = failureMessage;
112         return this;
113     }
114 
115     public String getFailureType()
116     {
117         return failureType;
118     }
119 
120     private ReportTestCase setFailureType( String failureType )
121     {
122         this.failureType = failureType;
123         return this;
124     }
125 
126     public String getFailureErrorLine()
127     {
128         return failureErrorLine;
129     }
130 
131     public ReportTestCase setFailureErrorLine( String failureErrorLine )
132     {
133         this.failureErrorLine = failureErrorLine;
134         return this;
135     }
136 
137     public String getFailureDetail()
138     {
139         return failureDetail;
140     }
141 
142     public ReportTestCase setFailureDetail( String failureDetail )
143     {
144         this.failureDetail = failureDetail;
145         return this;
146     }
147 
148     public ReportTestCase setFailure( String message, String type )
149     {
150         hasFailure = StringUtils.isNotBlank( type );
151         return setFailureMessage( message ).setFailureType( type );
152     }
153 
154     public boolean hasFailure()
155     {
156         return hasFailure;
157     }
158 
159     /**
160      * {@inheritDoc}
161      */
162     public String toString()
163     {
164         return fullName;
165     }
166 }