Coverage Report - org.apache.maven.surefire.junitcore.JUnitCoreStackTraceWriter
 
Classes in this File Line Coverage Branch Coverage Complexity
JUnitCoreStackTraceWriter
0%
0/6
N/A
1
 
 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.surefire.junitcore;
 20  
 
 21  
 
 22  
 import org.apache.maven.surefire.report.StackTraceWriter;
 23  
 import org.junit.runner.notification.Failure;
 24  
 
 25  
 /**
 26  
  * Writes out a specific {@link org.junit.runner.notification.Failure} for
 27  
  * surefire as a stacktrace.
 28  
  *
 29  
  * @author Karl M. Davis
 30  
  * @author Kristian Rosenvold (junit core adaption)
 31  
  */
 32  
 class JUnitCoreStackTraceWriter
 33  
     implements StackTraceWriter
 34  
 {
 35  
     // Member Variables
 36  
 
 37  
     private Failure junitFailure;
 38  
 
 39  
     /**
 40  
      * Constructor.
 41  
      *
 42  
      * @param junitFailure the {@link Failure} that this will be operating on
 43  
      */
 44  
     public JUnitCoreStackTraceWriter( Failure junitFailure )
 45  0
     {
 46  0
         this.junitFailure = junitFailure;
 47  0
     }
 48  
 
 49  
     /*
 50  
       * (non-Javadoc)
 51  
       *
 52  
       * @see org.apache.maven.surefire.report.StackTraceWriter#writeTraceToString()
 53  
       */
 54  
 
 55  
     public String writeTraceToString()
 56  
     {
 57  0
         return junitFailure.getTrace();
 58  
     }
 59  
 
 60  
     /**
 61  
      * At the moment, returns the same as {@link #writeTraceToString()}.
 62  
      *
 63  
      * @see org.apache.maven.surefire.report.StackTraceWriter#writeTrimmedTraceToString()
 64  
      */
 65  
     public String writeTrimmedTraceToString()
 66  
     {
 67  0
         return junitFailure.getTrace();
 68  
     }
 69  
 
 70  
     /**
 71  
      * Returns the exception associated with this failure.
 72  
      *
 73  
      * @see org.apache.maven.surefire.report.StackTraceWriter#getThrowable()
 74  
      */
 75  
     public Throwable getThrowable()
 76  
     {
 77  0
         return junitFailure.getException();
 78  
     }
 79  
 
 80  
 }