Clover coverage report - Code Coverage for tapestry release 4.0-alpha-3
Coverage timestamp: Mon May 16 2005 09:05:49 EDT
file stats: LOC: 71   Methods: 6
NCLOC: 38   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
MockServletConfig.java - 100% 100% 100%
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.test.mock;
 16   
 
 17   
 import java.util.Collections;
 18   
 import java.util.Enumeration;
 19   
 import java.util.HashMap;
 20   
 import java.util.Map;
 21   
 
 22   
 import javax.servlet.ServletConfig;
 23   
 import javax.servlet.ServletContext;
 24   
 
 25   
 /**
 26   
  * An implementation of {@link javax.servlet.ServletConfig} used
 27   
  * for Mock testing. 
 28   
  *
 29   
  * @author Howard Lewis Ship
 30   
  * @since 4.0
 31   
  */
 32   
 
 33   
 public class MockServletConfig implements ServletConfig, InitParameterHolder
 34   
 {
 35   
     private String _name;
 36   
     private ServletContext _context;
 37   
     private Map _initParameters = new HashMap();
 38   
 
 39  45
     public MockServletConfig(String name, ServletContext context)
 40   
     {
 41  45
         _name = name;
 42  45
         _context = context;
 43   
     }
 44   
 
 45  1380
     public String getInitParameter(String name)
 46   
     {
 47  1380
         return (String) _initParameters.get(name);
 48   
     }
 49   
 
 50  22
     public Enumeration getInitParameterNames()
 51   
     {
 52  22
         return Collections.enumeration(_initParameters.keySet());
 53   
     }
 54   
 
 55  261
     public ServletContext getServletContext()
 56   
     {
 57  261
         return _context;
 58   
     }
 59   
 
 60  402
     public String getServletName()
 61   
     {
 62  402
         return _name;
 63   
     }
 64   
 
 65  39
     public void setInitParameter(String name, String value)
 66   
     {
 67  39
         _initParameters.put(name, value);
 68   
     }
 69   
 
 70   
 }
 71