EMMA Coverage Report (generated Wed Feb 13 07:49:24 ICT 2008)
[all classes][net.sourceforge.hiveboard.util]

COVERAGE SUMMARY FOR SOURCE FILE [GuiTestingCauchoSerializerFactory.java]

nameclass, %method, %block, %line, %
GuiTestingCauchoSerializerFactory.java100% (1/1)100% (2/2)52%  (43/83)59%  (10.1/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class GuiTestingCauchoSerializerFactory100% (1/1)100% (2/2)52%  (43/83)59%  (10.1/17)
getDeserializer (String): Deserializer 100% (1/1)45%  (33/73)50%  (7.1/14)
GuiTestingCauchoSerializerFactory (Map, Log): void 100% (1/1)100% (10/10)100% (3/3)

1//  Copyright 2004-2007 Jean-Francois Poilpret
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 
15package net.sourceforge.hiveboard.util;
16 
17import java.util.Map;
18 
19import org.apache.commons.logging.Log;
20 
21import net.sourceforge.hiveremoting.caucho.CauchoSerializerFactory;
22 
23import com.caucho.hessian.io.Deserializer;
24import com.caucho.hessian.io.HessianProtocolException;
25 
26/**
27 * Special Caucho <code>SerializerFactory</code> used exclusively during abbot 
28 * GUI testing to work around some class loading problems during tests.
29 * @author Jean-Francois Poilpret
30 */
31public class GuiTestingCauchoSerializerFactory extends CauchoSerializerFactory
32{
33        public GuiTestingCauchoSerializerFactory(Map config, Log logger)
34        {
35                super(config, logger);
36                _loader = getClass().getClassLoader();
37        }
38        
39        // CSOFF: IllegalCatchCheck
40        @Override public Deserializer        getDeserializer(String type)
41                throws HessianProtocolException
42        {
43                ClassLoader loader = Thread.currentThread().getContextClassLoader();
44                try
45                {
46                        Thread.currentThread().setContextClassLoader(_loader);
47                        Deserializer result = super.getDeserializer(type);
48                        if (result == null)
49                        {
50                                _logger.debug("getDeserializer(\"" + type + "\") = null");
51                        }
52                        return result;
53                }
54                catch (HessianProtocolException e)
55                {
56                        _logger.error("getDeserializer(\"" + type + "\")", e);
57                        throw e;
58                }
59                catch (RuntimeException e)
60                {
61                        _logger.error("getDeserializer(\"" + type + "\")", e);
62                        throw e;
63                }
64                finally
65                {
66                        Thread.currentThread().setContextClassLoader(loader);
67                }
68        }
69        // CSON: IllegalCatchCheck
70        
71        private final ClassLoader        _loader;
72}

[all classes][net.sourceforge.hiveboard.util]
EMMA 2.0.5312 (C) Vladimir Roubtsov