Coverage Report - org.seasar.teeda.core.mock.MockServletRequestParameterMap
 
Classes in this File Line Coverage Branch Coverage Complexity
MockServletRequestParameterMap
78%
7/9
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.mock;
 17  
 
 18  
 import java.util.Enumeration;
 19  
 
 20  
 import org.seasar.framework.mock.servlet.MockHttpServletRequest;
 21  
 import org.seasar.teeda.core.context.AbstractExternalContextMap;
 22  
 
 23  
 /**
 24  
  * @author manhole
 25  
  */
 26  
 public class MockServletRequestParameterMap extends AbstractExternalContextMap {
 27  
 
 28  
     private final MockHttpServletRequest request_;
 29  
 
 30  50
     public MockServletRequestParameterMap(final MockHttpServletRequest request) {
 31  50
         request_ = request;
 32  50
     }
 33  
 
 34  
     protected Object getAttribute(String key) {
 35  103
         return request_.getParameter(key);
 36  
     }
 37  
 
 38  
     protected Enumeration getAttributeNames() {
 39  4
         return request_.getParameterNames();
 40  
     }
 41  
 
 42  
     protected void setAttribute(String key, Object value) {
 43  28
         request_.setParameter(key, (String) value);
 44  28
     }
 45  
 
 46  
     protected void removeAttribute(String key) {
 47  0
         request_.setParameter(key, (String) null);
 48  0
     }
 49  
 
 50  
 }