1 /* Licensed to the Apache Software Foundation (ASF) under one or more 2 * contributor license agreements. See the NOTICE file distributed with 3 * this work for additional information regarding copyright ownership. 4 * The ASF licenses this file to you under the Apache License, Version 2.0 5 * (the "License"); you may not use this file except in compliance with 6 * the License. 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, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.apache.myfaces.context; 18 19 import java.util.Enumeration; 20 import java.util.Map; 21 22 import javax.servlet.http.HttpServletRequest; 23 import javax.servlet.http.HttpServletRequestWrapper; 24 25 /** 26 * Context request wrapper 27 * to test various aspects of a 28 * of the facesContext which relies on requests! 29 * 30 * @author Werner Punz(latest modification by $Author: bommel $) 31 * @version $Revision: 954308 $ $Date: 2010-06-13 15:52:08 -0500 (Sun, 13 Jun 2010) $ 32 */ 33 public class ContextTestRequestWrapper extends HttpServletRequestWrapper { 34 Map<String, String> _paramDelegate = null; 35 36 /** 37 * Handling a normal servlet request with a new parameter map 38 * @param _delegate 39 * @param newRequestParameters 40 */ 41 public ContextTestRequestWrapper(HttpServletRequest _delegate, Map<String, String> newRequestParameters) { 42 super(_delegate); 43 _paramDelegate = newRequestParameters; 44 } 45 46 @Override 47 public String getParameter(String name) { 48 return _paramDelegate.get(name); 49 } 50 51 @Override 52 public Map getParameterMap() { 53 return _paramDelegate; 54 } 55 56 @Override 57 public Enumeration getParameterNames() { 58 throw new UnsupportedOperationException("not implemented"); 59 } 60 61 62 @Override 63 public String[] getParameterValues(String name) { 64 throw new UnsupportedOperationException("not implemented"); 65 } 66 67 68 69 }