Clover coverage report - Code Coverage for tapestry release 4.0-beta-12
Coverage timestamp: Sun Oct 30 2005 16:22:01 EST
file stats: LOC: 64   Methods: 3
NCLOC: 30   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
RequestExceptionReporterImpl.java 50% 91.7% 100% 88.2%
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.error;
 16   
 17    import org.apache.commons.logging.Log;
 18    import org.apache.tapestry.util.exception.ExceptionAnalyzer;
 19    import org.apache.tapestry.web.WebRequest;
 20    import org.apache.tapestry.web.WebSession;
 21   
 22    /**
 23    * @author Howard M. Lewis Ship
 24    * @since 4.0
 25    */
 26    public class RequestExceptionReporterImpl implements RequestExceptionReporter
 27    {
 28    private Log _log;
 29   
 30    private WebRequest _request;
 31   
 32  3 public void setLog(Log log)
 33    {
 34  3 _log = log;
 35    }
 36   
 37  3 public void setRequest(WebRequest request)
 38    {
 39  3 _request = request;
 40    }
 41   
 42  3 public void reportRequestException(String message, Throwable cause)
 43    {
 44  3 _log.warn(message, cause);
 45   
 46  3 System.err.println("\n\n**********************************************************\n\n");
 47   
 48  3 System.err.println(message);
 49   
 50  3 System.err.println("\n");
 51   
 52  3 WebSession session = _request.getSession(false);
 53   
 54  3 if (session != null)
 55  0 System.err.println(" Session id : " + session.getId());
 56   
 57  3 System.err.println("\nExceptions:\n");
 58   
 59  3 new ExceptionAnalyzer().reportException(cause, System.err);
 60   
 61  3 System.err.println("\n**********************************************************\n");
 62    }
 63   
 64    }