Clover coverage report - Code Coverage for tapestry release 3.1-alpha-1
Coverage timestamp: Mon Feb 21 2005 09:16:14 EST
file stats: LOC: 68   Methods: 3
NCLOC: 32   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
RequestExceptionReporterImpl.java 50% 92.3% 100% 88.9%
coverage coverage
 1   
 // Copyright 2004, 2005 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.tapestry.services.impl;
 16   
 
 17   
 import javax.servlet.http.HttpServletRequest;
 18   
 import javax.servlet.http.HttpSession;
 19   
 
 20   
 import org.apache.commons.logging.Log;
 21   
 import org.apache.tapestry.services.RequestExceptionReporter;
 22   
 import org.apache.tapestry.util.exception.ExceptionAnalyzer;
 23   
 
 24   
 /**
 25   
  * @author Howard M. Lewis Ship
 26   
  * @since 3.1
 27   
  */
 28   
 public class RequestExceptionReporterImpl implements RequestExceptionReporter
 29   
 {
 30   
     private Log _log;
 31   
 
 32   
     private HttpServletRequest _request;
 33   
 
 34  3
     public void setLog(Log log)
 35   
     {
 36  3
         _log = log;
 37   
     }
 38   
 
 39  3
     public void setRequest(HttpServletRequest request)
 40   
     {
 41  3
         _request = request;
 42   
     }
 43   
 
 44  3
     public void reportRequestException(String message, Throwable cause)
 45   
     {
 46  3
         _log.warn(message, cause);
 47   
 
 48  3
         System.err.println("\n\n**********************************************************\n\n");
 49   
 
 50  3
         System.err.println(message);
 51   
 
 52  3
         System.err.println("\n");
 53   
 
 54  3
         HttpSession session = _request.getSession();
 55   
 
 56  3
         if (session != null)
 57  0
             System.err.println("      Session id    : " + session.getId());
 58   
 
 59  3
         System.err.println("      Client address: " + _request.getRemoteAddr());
 60   
 
 61  3
         System.err.println("\nExceptions:\n");
 62   
 
 63  3
         new ExceptionAnalyzer().reportException(cause, System.err);
 64   
 
 65  3
         System.err.println("\n**********************************************************\n");
 66   
     }
 67   
 
 68   
 }