01: /*
02: * ========================================================================
03: *
04: * Copyright 2001-2004 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: * ========================================================================
19: */
20: package org.apache.cactus;
21:
22: import javax.servlet.jsp.JspWriter;
23:
24: import junit.framework.Test;
25:
26: import org.apache.cactus.internal.client.connector.http.HttpProtocolHandler;
27: import org.apache.cactus.internal.configuration.DefaultJspConfiguration;
28: import org.apache.cactus.server.PageContextWrapper;
29: import org.apache.cactus.spi.client.connector.ProtocolHandler;
30:
31: /**
32: * Test classes that need access to valid JSP implicit objects (such as the
33: * page context, the output jsp writer, the HTTP request, ...) must subclass
34: * this class.
35: *
36: * @version $Id: JspTestCase.java 238991 2004-05-22 11:34:50Z vmassol $
37: */
38: public class JspTestCase extends ServletTestCase {
39: /**
40: * Valid <code>PageContext</code> object that you can access from
41: * the <code>testXXX()</code>, <code>setUp</code> and
42: * <code>tearDown()</code> methods. If you try to access it from either the
43: * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
44: * have the <code>null</code> value.
45: */
46: public PageContextWrapper pageContext;
47:
48: /**
49: * Valid <code>JspWriter</code> object that you can access from
50: * the <code>testXXX()</code>, <code>setUp</code> and
51: * <code>tearDown()</code> methods. If you try to access it from either the
52: * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
53: * have the <code>null</code> value.
54: */
55: public JspWriter out;
56:
57: /**
58: * @see ServletTestCase#ServletTestCase()
59: */
60: public JspTestCase() {
61: super ();
62: }
63:
64: /**
65: * @see ServletTestCase#ServletTestCase(String)
66: */
67: public JspTestCase(String theName) {
68: super (theName);
69: }
70:
71: /**
72: * @see ServletTestCase#ServletTestCase(String, Test)
73: */
74: public JspTestCase(String theName, Test theTest) {
75: super (theName, theTest);
76: }
77:
78: /**
79: * @see ServletTestCase#createProtocolHandler()
80: */
81: protected ProtocolHandler createProtocolHandler() {
82: return new HttpProtocolHandler(new DefaultJspConfiguration());
83: }
84: }
|