KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > internal > TestAbstractCactusTestCase


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.internal;
21
22 import java.net.HttpURLConnection JavaDoc;
23
24 import org.apache.cactus.WebRequest;
25 import org.apache.cactus.WebResponse;
26
27 /**
28  * Unit tests of the {@link AbstractCactusTestCase} class.
29  *
30  * @version $Id: TestAbstractCactusTestCase.java,v 1.1 2004/05/22 11:34:49 vmassol Exp $
31  */

32 public class TestAbstractCactusTestCase
33     extends AbstractTestAbstractCactusTestCase
34 {
35     /**
36      * @see #testBeginMethodBadReturnType()
37      */

38     public String JavaDoc beginBeginMethodBadReturnType(WebRequest theRequest)
39     {
40         // Return anything just to make the compiler happy ...
41
return "";
42     }
43
44     /**
45      * Test that when a begin method for a given test does not have the correct
46      * return type (i.e. void), a <code>AssertionFailedError</code> exception
47      * is returned.
48      * Note: the assert is done in the
49      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
50      */

51     public void testBeginMethodBadReturnType()
52     {
53         // This method only exist so that a test exist and thus the begin
54
// method for that test will be called.
55
// Should not reach this point
56
fail("Should not reach this point");
57     }
58
59     //-------------------------------------------------------------------------
60

61     /**
62      * @see #testBeginMethodNotPublic()
63      */

64     private void beginBeginMethodNotPublic(WebRequest theRequest)
65     {
66     }
67
68     /**
69      * Test that when a begin method for a given test is not declared public
70      * a <code>AssertionFailedError</code> exception is returned.
71      * Note: the assert is done in the
72      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
73      */

74     public void testBeginMethodNotPublic()
75     {
76         // This method only exist so that a test exist and thus the begin
77
// method for that test will be called.
78
// Should not reach this point
79
fail("Should not reach this point");
80     }
81
82     //-------------------------------------------------------------------------
83

84     /**
85      * @see #testBeginMethodBadReturnType()
86      */

87     public void beginBeginMethodBadParamType(String JavaDoc theDummy)
88     {
89     }
90
91     /**
92      * Test that when a begin method for a given test has the wrong type of
93      * parameters, a <code>AssertionFailedError</code> exception is returned.
94      * Note: the assert is done in the
95      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
96      */

97     public void testBeginMethodBadParamType()
98     {
99         // This method only exist so that a test exist and thus the begin
100
// method for that test will be called.
101
// Should not reach this point
102
fail("Should not reach this point");
103     }
104
105     //-------------------------------------------------------------------------
106

107     /**
108      * @see #testBeginMethodBadParamNumber()
109      */

110     public void beginBeginMethodBadParamNumber(WebRequest theRequest,
111         String JavaDoc theString)
112     {
113     }
114
115     /**
116      * Test that when a begin method for a given test has the wrong number of
117      * parameters, a <code>AssertionFailedError</code> exception is returned.
118      * Note: the assert is done in the
119      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
120      */

121     public void testBeginMethodBadParamNumber()
122     {
123         // This method only exist so that a test exist and thus the begin
124
// method for that test will be called.
125
// Should not reach this point
126
fail("Should not reach this point");
127     }
128
129     //-------------------------------------------------------------------------
130

131     /**
132      * @see #testBeginMethodOK()
133      */

134     public void beginBeginMethodOK(WebRequest theRequest)
135     {
136         // We send an exception just to verify that this code has been reached
137
// The exception is intercepted in
138
// TestAbstractTestCaseInterceptorTestCase
139
fail("beginBeginMethodOK");
140     }
141
142     /**
143      * Verify that the begin method with a
144      * <code>WebRequest</code> parameter is called correctly.
145      */

146     public void testBeginMethodOK()
147     {
148     }
149
150     //-------------------------------------------------------------------------
151

152     /**
153      * Test that when an end method for a given test does not have the correct
154      * return type (i.e. void), a <code>AssertionFailedError</code> exception
155      * is returned.
156      * Note: the assert is done in the
157      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
158      */

159     public void testEndMethodBadReturnType()
160     {
161         // This method only exist so that a test exist and thus the begin
162
// method for that test will be called.
163
}
164
165     /**
166      * @see #testEndMethodBadReturnType()
167      */

168     public String JavaDoc endEndMethodBadReturnType(WebResponse theResponse)
169     {
170         // Return anything just to make the compiler happy ...
171
return "";
172     }
173
174     //-------------------------------------------------------------------------
175

176     /**
177      * Test that when an end method for a given test is not declared public
178      * a <code>AssertionFailedError</code> exception is returned.
179      * Note: the assert is done in the
180      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
181      */

182     public void testEndMethodNotPublic()
183     {
184     }
185
186     /**
187      * @see #testEndMethodNotPublic()
188      */

189     private void endEndMethodNotPublic(WebResponse theResponse)
190     {
191     }
192
193     //-------------------------------------------------------------------------
194

195     /**
196      * Test that when an end method for a given test has the wrong type of
197      * parameters, a <code>AssertionFailedError</code> exception is returned.
198      * Note: the assert is done in the
199      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
200      */

201     public void testEndMethodBadParamType()
202     {
203     }
204
205     /**
206      * @see #testEndMethodBadParamType()
207      */

208     public void endEndMethodBadParamType(String JavaDoc theDummy)
209     {
210     }
211
212     //-------------------------------------------------------------------------
213

214     /**
215      * Test that when an end method for a given test has the wrong number of
216      * parameters, a <code>AssertionFailedError</code> exception is returned.
217      * Note: the assert is done in the
218      * <code>TestAbstractTestCaseInterceptorTestCase</code> class.
219      */

220     public void testEndMethodBadParamNumber()
221     {
222     }
223
224     /**
225      * @see #testEndMethodBadParamNumber()
226      */

227     public void endEndMethodBadParamNumber(WebResponse theResponse,
228         String JavaDoc theDummy)
229     {
230     }
231
232     //-------------------------------------------------------------------------
233

234     /**
235      * Test that the end method is called correctly when it's signature
236      * contains a <code>org.apache.cactus.WebResponse</code> parameter.
237      */

238     public void testEndMethodOK1()
239     {
240     }
241
242     /**
243      * @see #testEndMethodOK1()
244      */

245     public void endEndMethodOK1(WebResponse theResponse)
246     {
247         // We send an exception just to verify that this code has been reached
248
// The exception is intercepted in
249
// TestAbstractTestCaseInterceptorTestCase
250
fail("endEndMethodOK1");
251     }
252
253     //-------------------------------------------------------------------------
254

255     /**
256      * Test that the end method is called correctly when it's signature
257      * contains a <code>com.meterware.httpunit.WebResponse</code> parameter.
258      *
259      * Note: We need the Httpunit jar and an XML parser jar on the classpath
260      * for this test
261      */

262     public void testEndMethodOK2()
263     {
264     }
265
266     /**
267      * @see #testEndMethodOK2()
268      */

269     public void endEndMethodOK2(com.meterware.httpunit.WebResponse theResponse)
270     {
271         // We send an exception just to verify that this code has been reached
272
// The exception is intercepted in
273
// TestAbstractTestCaseInterceptorTestCase
274
fail("endEndMethodOK2");
275     }
276
277     //-------------------------------------------------------------------------
278

279     /**
280      * Test that the deprecated end method with the
281      * <code>HttpURLConnection</code> parameter can still be called correctly.
282      */

283     public void testEndMethodOK3()
284     {
285     }
286
287     /**
288      * @see #testEndMethodOK3()
289      */

290     public void endEndMethodOK3(HttpURLConnection JavaDoc theResponse)
291     {
292         // We send an exception just to verify that this code has been reached
293
// The exception is intercepted in
294
// TestAbstractTestCaseInterceptorTestCase
295
fail("endEndMethodOK3");
296     }
297 }
298
Popular Tags