Coverage Report - org.apache.maven.surefire.report.CategorizedReportEntry
 
Classes in this File Line Coverage Branch Coverage Complexity
CategorizedReportEntry
0%
0/21
0%
0/18
2,429
 
 1  
 package org.apache.maven.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  
 /**
 23  
  * @author Kristian Rosenvold
 24  
  */
 25  
 public class CategorizedReportEntry
 26  
     extends SimpleReportEntry
 27  
     implements ReportEntry
 28  
 {
 29  
     private final String group;
 30  
 
 31  
     public CategorizedReportEntry( String source, String name, String group )
 32  
     {
 33  0
         this( source, name, group, null, null );
 34  0
     }
 35  
 
 36  
     public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter,
 37  
                                    Integer elapsed )
 38  
     {
 39  0
         super( source, name, stackTraceWriter, elapsed );
 40  0
         this.group = group;
 41  0
     }
 42  
 
 43  
     public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter,
 44  
                                    Integer elapsed, String message )
 45  
     {
 46  0
         super( source, name, stackTraceWriter, elapsed, message );
 47  0
         this.group = group;
 48  0
     }
 49  
 
 50  
     public static ReportEntry reportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter,
 51  
                                            Integer elapsed, String message )
 52  
     {
 53  0
         return group != null
 54  
             ? new CategorizedReportEntry( source, name, group, stackTraceWriter, elapsed, message )
 55  
             : new SimpleReportEntry( source, name, stackTraceWriter, elapsed, message );
 56  
     }
 57  
 
 58  
     public String getGroup()
 59  
     {
 60  0
         return group;
 61  
     }
 62  
 
 63  
     public boolean equals( Object o )
 64  
     {
 65  0
         if ( this == o )
 66  
         {
 67  0
             return true;
 68  
         }
 69  0
         if ( o == null || getClass() != o.getClass() )
 70  
         {
 71  0
             return false;
 72  
         }
 73  0
         if ( !super.equals( o ) )
 74  
         {
 75  0
             return false;
 76  
         }
 77  
 
 78  0
         CategorizedReportEntry that = (CategorizedReportEntry) o;
 79  
 
 80  0
         return !( group != null ? !group.equals( that.group ) : that.group != null );
 81  
 
 82  
     }
 83  
 
 84  
     public int hashCode()
 85  
     {
 86  0
         int result = super.hashCode();
 87  0
         result = 31 * result + ( group != null ? group.hashCode() : 0 );
 88  0
         return result;
 89  
     }
 90  
 }