1   /* Copyright 2004 Acegi Technology Pty Limited
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  
16  package org.acegisecurity;
17  
18  import java.util.Enumeration;
19  import java.util.HashMap;
20  import java.util.Map;
21  
22  import javax.servlet.FilterConfig;
23  import javax.servlet.ServletContext;
24  
25  
26  /***
27   * DOCUMENT ME!
28   *
29   * @author Ben Alex
30   * @version $Id: MockFilterConfig.java,v 1.2 2005/11/17 00:55:47 benalex Exp $
31   */
32  public class MockFilterConfig implements FilterConfig {
33      //~ Instance fields ========================================================
34  
35      private Map map = new HashMap();
36  
37      //~ Methods ================================================================
38  
39      public String getFilterName() {
40          throw new UnsupportedOperationException("mock method not implemented");
41      }
42  
43      public String getInitParameter(String arg0) {
44          Object result = map.get(arg0);
45  
46          if (result != null) {
47              return (String) result;
48          } else {
49              return null;
50          }
51      }
52  
53      public Enumeration getInitParameterNames() {
54          throw new UnsupportedOperationException("mock method not implemented");
55      }
56  
57      public void setInitParmeter(String parameter, String value) {
58          map.put(parameter, value);
59      }
60  
61      public ServletContext getServletContext() {
62          throw new UnsupportedOperationException("mock method not implemented");
63      }
64  }