01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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: * DOCUMENT ME!
27: *
28: * @author Ben Alex
29: * @version $Id: MockFilterConfig.java 1496 2006-05-23 13:38:33Z benalex $
30: */
31: public class MockFilterConfig implements FilterConfig {
32: //~ Instance fields ================================================================================================
33:
34: private Map map = new HashMap();
35:
36: //~ Methods ========================================================================================================
37:
38: public String getFilterName() {
39: throw new UnsupportedOperationException(
40: "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(
55: "mock method not implemented");
56: }
57:
58: public ServletContext getServletContext() {
59: throw new UnsupportedOperationException(
60: "mock method not implemented");
61: }
62:
63: public void setInitParmeter(String parameter, String value) {
64: map.put(parameter, value);
65: }
66: }
|