KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > servlet > MockPageContext


1 package com.mockobjects.servlet;
2
3 import java.util.*;
4 import javax.servlet.*;
5 import javax.servlet.http.*;
6 import javax.servlet.jsp.*;
7
8 public class MockPageContext extends PageContext{
9     private JspWriter jspWriter;
10     private ServletRequest request;
11     private HttpSession httpSession;
12     private ServletContext servletContext;
13
14     public void release(){
15     }
16
17     public JspWriter getOut(){
18         return jspWriter;
19     }
20
21     public void setJspWriter(JspWriter jspWriter){
22         this.jspWriter = jspWriter;
23     }
24
25     public void handlePageException(Exception JavaDoc e){
26     }
27
28     public ServletContext getServletContext(){
29         return servletContext;
30     }
31
32     public void setServletContext(ServletContext servletContext){
33         this.servletContext = servletContext;
34     }
35
36     public int getAttributesScope(String JavaDoc s){
37         return -1;
38     }
39
40     public void include(String JavaDoc s){
41     }
42
43     public void removeAttribute(String JavaDoc s, int i){
44     }
45
46     public Enumeration getAttributeNamesInScope(int i){
47         return null;
48     }
49
50     public void forward(String JavaDoc s){
51     }
52
53     public Object JavaDoc getPage(){
54         return null;
55     }
56
57     public void handlePageException(Throwable JavaDoc t){
58     }
59
60     public void setRequest(ServletRequest servletRequest){
61         this.request = servletRequest;
62     }
63
64     public ServletRequest getRequest(){
65         return request;
66     }
67
68     public ServletResponse getResponse(){
69         return null;
70     }
71
72     public void removeAttribute(String JavaDoc s){
73     }
74
75     public Object JavaDoc getAttribute(String JavaDoc s, int i){
76         return null;
77     }
78
79     public ServletConfig getServletConfig(){
80         return null;
81     }
82
83     public void initialize(Servlet servlet, ServletRequest servletRequest, ServletResponse servletResponse, String JavaDoc s, boolean b, int i, boolean b2){
84     }
85
86     public Object JavaDoc findAttribute(String JavaDoc s) {
87         return null;
88     }
89
90     public HttpSession getSession() {
91         return httpSession;
92     }
93
94     public void setSession(HttpSession httpSession) {
95         this.httpSession = httpSession;
96     }
97
98     public void setAttribute(String JavaDoc s, Object JavaDoc o){
99     }
100
101     public void setAttribute(String JavaDoc s, Object JavaDoc o, int i) {
102     }
103
104     public Object JavaDoc getAttribute(String JavaDoc s) {
105         return null;
106     }
107
108     public Exception JavaDoc getException() {
109             return null;
110     }
111
112     public void verify(){
113     }
114 }
115
Popular Tags