1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
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 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
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 |
41
| public MockServletConfig(String name, ServletContext context)
|
40 |
| { |
41 |
41
| _name = name;
|
42 |
41
| _context = context;
|
43 |
| } |
44 |
| |
45 |
1351
| public String getInitParameter(String name)
|
46 |
| { |
47 |
1351
| return (String) _initParameters.get(name);
|
48 |
| } |
49 |
| |
50 |
21
| public Enumeration getInitParameterNames()
|
51 |
| { |
52 |
21
| return Collections.enumeration(_initParameters.keySet());
|
53 |
| } |
54 |
| |
55 |
237
| public ServletContext getServletContext()
|
56 |
| { |
57 |
237
| return _context;
|
58 |
| } |
59 |
| |
60 |
364
| public String getServletName()
|
61 |
| { |
62 |
364
| return _name;
|
63 |
| } |
64 |
| |
65 |
37
| public void setInitParameter(String name, String value)
|
66 |
| { |
67 |
37
| _initParameters.put(name, value);
|
68 |
| } |
69 |
| |
70 |
| } |