KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > junit > internal > http > MockJspFactory


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.junit.internal.http;
8
9
10 import javax.servlet.Servlet JavaDoc;
11 import javax.servlet.ServletRequest JavaDoc;
12 import javax.servlet.ServletResponse JavaDoc;
13 import javax.servlet.jsp.JspEngineInfo JavaDoc;
14 import javax.servlet.jsp.JspFactory JavaDoc;
15 import javax.servlet.jsp.PageContext JavaDoc;
16
17
18 /**
19  * <p>
20  * This class is a mock implementation of the JspFactory
21  * </p>
22  *
23  * @author Brian Pontarelli
24  * @since 2.0
25  * @version 2.0
26  */

27 public class MockJspFactory extends JspFactory JavaDoc {
28
29     /**
30      * Constructor for MockJspFactory.
31      */

32     public MockJspFactory() {
33         super();
34     }
35
36
37     /**
38      * @see javax.servlet.jsp.JspFactory#getPageContext(javax.servlet.Servlet, javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String, boolean, int, boolean)
39      */

40     public PageContext JavaDoc getPageContext(Servlet JavaDoc servlet, ServletRequest JavaDoc request,
41             ServletResponse JavaDoc response, String JavaDoc errorURL, boolean needsSession,
42             int buffer, boolean autoFlush) {
43         return new MockPageContext(servlet.getServletConfig(), request, response);
44     }
45
46     /**
47      * @see javax.servlet.jsp.JspFactory#releasePageContext(javax.servlet.jsp.PageContext)
48      */

49     public void releasePageContext(PageContext JavaDoc pageContext) {
50     }
51
52     /**
53      * @see javax.servlet.jsp.JspFactory#getEngineInfo()
54      */

55     public JspEngineInfo JavaDoc getEngineInfo() {
56         return new MockJspEngineInfo();
57     }
58 }
Popular Tags