2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.test.mock;
19
20 import java.io.UnsupportedEncodingException;
21 import javax.servlet.ServletContext;
22 import javax.servlet.http.HttpServletRequest;
23 import javax.servlet.http.HttpServletResponse;
24
25 /***
26 * <p>Mock implementation of <code>ExternalContext</code> that includes the semantics
27 * added by JavaServer Faces 1.2.</p>
28 *
29 * $Id: MockExternalContext12.java 464373 2006-10-16 04:21:54Z rahul $
30 *
31 * @since 1.0.4
32 */
33
34 public class MockExternalContext12 extends MockExternalContext {
35
36
37
38
39
40 public MockExternalContext12(ServletContext context,
41 HttpServletRequest request,
42 HttpServletResponse response) {
43 super(context, request, response);
44 }
45
46
47
48
49
50
51
52
53
54
55
56 /*** {@inheritDoc} */
57 public String getRequestCharacterEncoding() {
58
59 return this.request.getCharacterEncoding();
60
61 }
62
63
64 /*** {@inheritDoc} */
65 public String getRequestContentType() {
66
67 return this.request.getContentType();
68
69 }
70
71
72 /*** {@inheritDoc} */
73 public String getResponseCharacterEncoding() {
74
75 return this.response.getCharacterEncoding();
76
77 }
78
79
80 /*** {@inheritDoc} */
81 public String getResponseContentType() {
82
83 return this.response.getContentType();
84
85 }
86
87
88 /*** {@inheritDoc} */
89 public void setRequest(Object request) {
90
91 this.request = (HttpServletRequest) request;
92
93 }
94
95
96 /*** {@inheritDoc} */
97 public void setRequestCharacterEncoding(String encoding) throws UnsupportedEncodingException {
98
99 this.request.setCharacterEncoding(encoding);
100
101 }
102
103
104 /*** {@inheritDoc} */
105 public void setResponse(Object response) {
106
107 this.response = (HttpServletResponse) response;
108
109 }
110
111
112 /*** {@inheritDoc} */
113 public void setResponseCharacterEncoding(String encoding) {
114
115 this.response.setCharacterEncoding(encoding);
116
117 }
118
119
120 }