KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > JspTestCase


1 /*
2  * ========================================================================
3  *
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
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 JavaDoc;
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,v 1.1 2004/05/22 11:34:45 vmassol Exp $
37  */

38 public class JspTestCase extends ServletTestCase
39 {
40     /**
41      * Valid <code>PageContext</code> object that you can access from
42      * the <code>testXXX()</code>, <code>setUp</code> and
43      * <code>tearDown()</code> methods. If you try to access it from either the
44      * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
45      * have the <code>null</code> value.
46      */

47     public PageContextWrapper pageContext;
48
49     /**
50      * Valid <code>JspWriter</code> object that you can access from
51      * the <code>testXXX()</code>, <code>setUp</code> and
52      * <code>tearDown()</code> methods. If you try to access it from either the
53      * <code>beginXXX()</code> or <code>endXXX()</code> methods it will
54      * have the <code>null</code> value.
55      */

56     public JspWriter JavaDoc out;
57
58     /**
59      * @see ServletTestCase#ServletTestCase()
60      */

61     public JspTestCase()
62     {
63         super();
64     }
65
66     /**
67      * @see ServletTestCase#ServletTestCase(String)
68      */

69     public JspTestCase(String JavaDoc theName)
70     {
71         super(theName);
72     }
73
74     /**
75      * @see ServletTestCase#ServletTestCase(String, Test)
76      */

77     public JspTestCase(String JavaDoc theName, Test theTest)
78     {
79         super(theName, theTest);
80     }
81
82     /**
83      * @see ServletTestCase#createProtocolHandler()
84      */

85     protected ProtocolHandler createProtocolHandler()
86     {
87         return new HttpProtocolHandler(new DefaultJspConfiguration());
88     }
89 }
90
Popular Tags