KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > taglib > bean > TestSizeTag


1 /*
2  * $Id: TestSizeTag.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 1999-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 package org.apache.struts.taglib.bean;
19
20 import java.io.IOException JavaDoc;
21 import java.util.ArrayList JavaDoc;
22 import java.util.Collection JavaDoc;
23 import java.util.HashMap JavaDoc;
24 import java.util.Map JavaDoc;
25
26 import javax.servlet.ServletException JavaDoc;
27 import javax.servlet.jsp.PageContext JavaDoc;
28
29 import junit.framework.Test;
30 import junit.framework.TestSuite;
31
32 import org.apache.cactus.WebResponse;
33 import org.apache.struts.taglib.SimpleBeanForTesting;
34 import org.apache.struts.taglib.TaglibTestBase;
35
36 /**
37  * Suite of unit tests for the
38  * <code>org.apache.struts.taglib.bean.SizeTag</code> class.
39  *
40  */

41 public class TestSizeTag extends TaglibTestBase {
42     protected final static String JavaDoc TEST_VAL = "Test Value";
43     protected final static String JavaDoc REQUEST_KEY = "REQUEST_KEY";
44     private String JavaDoc [] strings = { TEST_VAL, TEST_VAL, TEST_VAL };
45     private Collection JavaDoc collection = new ArrayList JavaDoc();
46     private Map JavaDoc map = new HashMap JavaDoc();
47
48     /**
49      * Defines the testcase name for JUnit.
50      *
51      * @param theName the testcase's name.
52      */

53     public TestSizeTag(String JavaDoc theName) {
54         super(theName);
55     }
56
57     /**
58      * Start the tests.
59      *
60      * @param theArgs the arguments. Not used
61      */

62     public static void main(String JavaDoc[] theArgs) {
63         junit.awtui.TestRunner.main(new String JavaDoc[] {TestSizeTag.class.getName()});
64     }
65
66     /**
67      * @return a test suite (<code>TestSuite</code>) that includes all methods
68      * starting with "test"
69      */

70     public static Test suite() {
71         // All methods starting with "test" will be executed in the test suite.
72
return new TestSuite(TestSizeTag.class);
73     }
74     
75     public void setUp() {
76         for (int i = 0; i < 3; i++) {
77             collection.add(TEST_VAL + i);
78         }
79         for (int i = 0; i < 3; i++) {
80             map.put(REQUEST_KEY + i, TEST_VAL + i);
81         }
82     }
83     
84     private void formatAndTest(String JavaDoc compare, String JavaDoc output) {
85         //fix for introduced carriage return / line feeds
86
output = replace(output,"\r","");
87         output = replace(output,"\n","");
88         output = output.trim();
89         //System.out.println("Testing [" + compare + "] == [" + output + "]");
90
assertEquals(compare, output);
91     }
92
93
94
95     // Array
96
public void testSizeTagNameArrayNoScope() throws IOException JavaDoc, ServletException JavaDoc{
97         request.setAttribute("runTest", "testSizeTagNameArrayNoScope");
98         request.setAttribute(REQUEST_KEY, strings);
99         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
100     }
101     public void endSizeTagNameArrayNoScope(WebResponse response){
102         formatAndTest("3", response.getText());
103     }
104
105     public void testSizeTagNameArrayApplicationScope() throws IOException JavaDoc, ServletException JavaDoc{
106         request.setAttribute("runTest", "testSizeTagNameArrayApplicationScope");
107         pageContext.setAttribute(REQUEST_KEY, strings, PageContext.APPLICATION_SCOPE);
108         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
109     }
110     public void endSizeTagNameArrayApplicationScope(WebResponse response){
111         formatAndTest("3", response.getText());
112     }
113
114     public void testSizeTagNameArraySessionScope() throws IOException JavaDoc, ServletException JavaDoc{
115         request.setAttribute("runTest", "testSizeTagNameArraySessionScope");
116         pageContext.setAttribute(REQUEST_KEY, strings, PageContext.SESSION_SCOPE);
117         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
118     }
119     public void endSizeTagNameArraySessionScope(WebResponse response){
120         formatAndTest("3", response.getText());
121     }
122
123     public void testSizeTagNameArrayRequestScope() throws IOException JavaDoc, ServletException JavaDoc{
124         request.setAttribute("runTest", "testSizeTagNameArrayRequestScope");
125         pageContext.setAttribute(REQUEST_KEY, strings, PageContext.REQUEST_SCOPE);
126         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
127     }
128     public void endSizeTagNameArrayRequestScope(WebResponse response){
129         formatAndTest("3", response.getText());
130     }
131
132
133     public void testSizeTagNamePropertyArrayNoScope() throws IOException JavaDoc, ServletException JavaDoc{
134         request.setAttribute("runTest", "testSizeTagNamePropertyArrayNoScope");
135         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
136         sbft.setArray(strings);
137         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
138         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
139     }
140     public void endSizeTagNamePropertyArrayNoScope(WebResponse response){
141         formatAndTest("3", response.getText());
142     }
143
144     public void testSizeTagNamePropertyArrayApplicationScope() throws IOException JavaDoc, ServletException JavaDoc{
145         request.setAttribute("runTest", "testSizeTagNamePropertyArrayApplicationScope");
146         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
147         sbft.setArray(strings);
148         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
149         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
150     }
151     public void endSizeTagNamePropertyArrayApplicationScope(WebResponse response){
152         formatAndTest("3", response.getText());
153     }
154
155     public void testSizeTagNamePropertyArraySessionScope() throws IOException JavaDoc, ServletException JavaDoc{
156         request.setAttribute("runTest", "testSizeTagNamePropertyArraySessionScope");
157         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
158         sbft.setArray(strings);
159         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
160         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
161     }
162     public void endSizeTagNamePropertyArraySessionScope(WebResponse response){
163         formatAndTest("3", response.getText());
164     }
165
166     public void testSizeTagNamePropertyArrayRequestScope() throws IOException JavaDoc, ServletException JavaDoc{
167         request.setAttribute("runTest", "testSizeTagNamePropertyArrayRequestScope");
168         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
169         sbft.setArray(strings);
170         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
171         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
172     }
173     public void endSizeTagNamePropertyArrayRequestScope(WebResponse response){
174         formatAndTest("3", response.getText());
175     }
176
177
178
179
180     public void testSizeTagNamePropertyArrayNoScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
181         request.setAttribute("runTest", "testSizeTagNamePropertyArrayNoScopeNested");
182         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
183         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
184         sbft.setArray(strings);
185         sbft2.setNestedObject(sbft);
186         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
187         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
188     }
189     public void endSizeTagNamePropertyArrayNoScopeNested(WebResponse response){
190         formatAndTest("3", response.getText());
191     }
192
193     public void testSizeTagNamePropertyArrayApplicationScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
194         request.setAttribute("runTest", "testSizeTagNamePropertyArrayApplicationScopeNested");
195         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
196         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
197         sbft.setArray(strings);
198         sbft2.setNestedObject(sbft);
199         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
200         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
201     }
202     public void endSizeTagNamePropertyArrayApplicationScopeNested(WebResponse response){
203         formatAndTest("3", response.getText());
204     }
205
206     public void testSizeTagNamePropertyArraySessionScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
207         request.setAttribute("runTest", "testSizeTagNamePropertyArraySessionScopeNested");
208         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
209         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
210         sbft.setArray(strings);
211         sbft2.setNestedObject(sbft);
212         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
213         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
214     }
215     public void endSizeTagNamePropertyArraySessionScopeNested(WebResponse response){
216         formatAndTest("3", response.getText());
217     }
218
219     public void testSizeTagNamePropertyArrayRequestScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
220         request.setAttribute("runTest", "testSizeTagNamePropertyArrayRequestScopeNested");
221         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
222         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
223         sbft.setArray(strings);
224         sbft2.setNestedObject(sbft);
225         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
226         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
227     }
228     public void endSizeTagNamePropertyArrayRequestScopeNested(WebResponse response){
229         formatAndTest("3", response.getText());
230     }
231
232
233
234     // Collection
235
public void testSizeTagNameCollectionNoScope() throws IOException JavaDoc, ServletException JavaDoc{
236         request.setAttribute("runTest", "testSizeTagNameCollectionNoScope");
237         request.setAttribute(REQUEST_KEY, collection);
238         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
239     }
240     public void endSizeTagNameCollectionNoScope(WebResponse response){
241         formatAndTest("3", response.getText());
242     }
243
244     public void testSizeTagNameCollectionApplicationScope() throws IOException JavaDoc, ServletException JavaDoc{
245         request.setAttribute("runTest", "testSizeTagNameCollectionApplicationScope");
246         pageContext.setAttribute(REQUEST_KEY, collection, PageContext.APPLICATION_SCOPE);
247         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
248     }
249     public void endSizeTagNameCollectionApplicationScope(WebResponse response){
250         formatAndTest("3", response.getText());
251     }
252
253     public void testSizeTagNameCollectionSessionScope() throws IOException JavaDoc, ServletException JavaDoc{
254         request.setAttribute("runTest", "testSizeTagNameCollectionSessionScope");
255         pageContext.setAttribute(REQUEST_KEY, collection, PageContext.SESSION_SCOPE);
256         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
257     }
258     public void endSizeTagNameCollectionSessionScope(WebResponse response){
259         formatAndTest("3", response.getText());
260     }
261
262     public void testSizeTagNameCollectionRequestScope() throws IOException JavaDoc, ServletException JavaDoc{
263         request.setAttribute("runTest", "testSizeTagNameCollectionRequestScope");
264         pageContext.setAttribute(REQUEST_KEY, collection, PageContext.REQUEST_SCOPE);
265         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
266     }
267     public void endSizeTagNameCollectionRequestScope(WebResponse response){
268         formatAndTest("3", response.getText());
269     }
270
271
272     public void testSizeTagNamePropertyCollectionNoScope() throws IOException JavaDoc, ServletException JavaDoc{
273         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionNoScope");
274         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
275         sbft.setCollection(collection);
276         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
277         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
278     }
279     public void endSizeTagNamePropertyCollectionNoScope(WebResponse response){
280         formatAndTest("3", response.getText());
281     }
282
283     public void testSizeTagNamePropertyCollectionApplicationScope() throws IOException JavaDoc, ServletException JavaDoc{
284         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionApplicationScope");
285         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
286         sbft.setCollection(collection);
287         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
288         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
289     }
290     public void endSizeTagNamePropertyCollectionApplicationScope(WebResponse response){
291         formatAndTest("3", response.getText());
292     }
293
294     public void testSizeTagNamePropertyCollectionSessionScope() throws IOException JavaDoc, ServletException JavaDoc{
295         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionSessionScope");
296         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
297         sbft.setCollection(collection);
298         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
299         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
300     }
301     public void endSizeTagNamePropertyCollectionSessionScope(WebResponse response){
302         formatAndTest("3", response.getText());
303     }
304
305     public void testSizeTagNamePropertyCollectionRequestScope() throws IOException JavaDoc, ServletException JavaDoc{
306         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionRequestScope");
307         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
308         sbft.setCollection(collection);
309         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
310         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
311     }
312     public void endSizeTagNamePropertyCollectionRequestScope(WebResponse response){
313         formatAndTest("3", response.getText());
314     }
315
316
317
318
319     public void testSizeTagNamePropertyCollectionNoScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
320         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionNoScopeNested");
321         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
322         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
323         sbft.setCollection(collection);
324         sbft2.setNestedObject(sbft);
325         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
326         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
327     }
328     public void endSizeTagNamePropertyCollectionNoScopeNested(WebResponse response){
329         formatAndTest("3", response.getText());
330     }
331
332     public void testSizeTagNamePropertyCollectionApplicationScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
333         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionApplicationScopeNested");
334         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
335         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
336         sbft.setCollection(collection);
337         sbft2.setNestedObject(sbft);
338         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
339         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
340     }
341     public void endSizeTagNamePropertyCollectionApplicationScopeNested(WebResponse response){
342         formatAndTest("3", response.getText());
343     }
344
345     public void testSizeTagNamePropertyCollectionSessionScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
346         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionSessionScopeNested");
347         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
348         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
349         sbft.setCollection(collection);
350         sbft2.setNestedObject(sbft);
351         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
352         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
353     }
354     public void endSizeTagNamePropertyCollectionSessionScopeNested(WebResponse response){
355         formatAndTest("3", response.getText());
356     }
357
358     public void testSizeTagNamePropertyCollectionRequestScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
359         request.setAttribute("runTest", "testSizeTagNamePropertyCollectionRequestScopeNested");
360         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
361         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
362         sbft.setCollection(collection);
363         sbft2.setNestedObject(sbft);
364         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
365         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
366     }
367     public void endSizeTagNamePropertyCollectionRequestScopeNested(WebResponse response){
368         formatAndTest("3", response.getText());
369     }
370
371
372
373     // Map
374
public void testSizeTagNameMapNoScope() throws IOException JavaDoc, ServletException JavaDoc{
375         request.setAttribute("runTest", "testSizeTagNameMapNoScope");
376         request.setAttribute(REQUEST_KEY, map);
377         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
378     }
379     public void endSizeTagNameMapNoScope(WebResponse response){
380         formatAndTest("3", response.getText());
381     }
382
383     public void testSizeTagNameMapApplicationScope() throws IOException JavaDoc, ServletException JavaDoc{
384         request.setAttribute("runTest", "testSizeTagNameMapApplicationScope");
385         pageContext.setAttribute(REQUEST_KEY, map, PageContext.APPLICATION_SCOPE);
386         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
387     }
388     public void endSizeTagNameMapApplicationScope(WebResponse response){
389         formatAndTest("3", response.getText());
390     }
391
392     public void testSizeTagNameMapSessionScope() throws IOException JavaDoc, ServletException JavaDoc{
393         request.setAttribute("runTest", "testSizeTagNameMapSessionScope");
394         pageContext.setAttribute(REQUEST_KEY, map, PageContext.SESSION_SCOPE);
395         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
396     }
397     public void endSizeTagNameMapSessionScope(WebResponse response){
398         formatAndTest("3", response.getText());
399     }
400
401     public void testSizeTagNameMapRequestScope() throws IOException JavaDoc, ServletException JavaDoc{
402         request.setAttribute("runTest", "testSizeTagNameMapRequestScope");
403         pageContext.setAttribute(REQUEST_KEY, map, PageContext.REQUEST_SCOPE);
404         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
405     }
406     public void endSizeTagNameMapRequestScope(WebResponse response){
407         formatAndTest("3", response.getText());
408     }
409
410
411     public void testSizeTagNamePropertyMapNoScope() throws IOException JavaDoc, ServletException JavaDoc{
412         request.setAttribute("runTest", "testSizeTagNamePropertyMapNoScope");
413         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
414         sbft.setMap(map);
415         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
416         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
417     }
418     public void endSizeTagNamePropertyMapNoScope(WebResponse response){
419         formatAndTest("3", response.getText());
420     }
421
422     public void testSizeTagNamePropertyMapApplicationScope() throws IOException JavaDoc, ServletException JavaDoc{
423         request.setAttribute("runTest", "testSizeTagNamePropertyMapApplicationScope");
424         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
425         sbft.setMap(map);
426         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
427         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
428     }
429     public void endSizeTagNamePropertyMapApplicationScope(WebResponse response){
430         formatAndTest("3", response.getText());
431     }
432
433     public void testSizeTagNamePropertyMapSessionScope() throws IOException JavaDoc, ServletException JavaDoc{
434         request.setAttribute("runTest", "testSizeTagNamePropertyMapSessionScope");
435         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
436         sbft.setMap(map);
437         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
438         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
439     }
440     public void endSizeTagNamePropertyMapSessionScope(WebResponse response){
441         formatAndTest("3", response.getText());
442     }
443
444     public void testSizeTagNamePropertyMapRequestScope() throws IOException JavaDoc, ServletException JavaDoc{
445         request.setAttribute("runTest", "testSizeTagNamePropertyMapRequestScope");
446         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
447         sbft.setMap(map);
448         pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
449         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
450     }
451     public void endSizeTagNamePropertyMapRequestScope(WebResponse response){
452         formatAndTest("3", response.getText());
453     }
454
455
456
457
458     public void testSizeTagNamePropertyMapNoScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
459         request.setAttribute("runTest", "testSizeTagNamePropertyMapNoScopeNested");
460         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
461         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
462         sbft.setMap(map);
463         sbft2.setNestedObject(sbft);
464         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
465         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
466     }
467     public void endSizeTagNamePropertyMapNoScopeNested(WebResponse response){
468         formatAndTest("3", response.getText());
469     }
470
471     public void testSizeTagNamePropertyMapApplicationScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
472         request.setAttribute("runTest", "testSizeTagNamePropertyMapApplicationScopeNested");
473         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
474         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
475         sbft.setMap(map);
476         sbft2.setNestedObject(sbft);
477         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
478         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
479     }
480     public void endSizeTagNamePropertyMapApplicationScopeNested(WebResponse response){
481         formatAndTest("3", response.getText());
482     }
483
484     public void testSizeTagNamePropertyMapSessionScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
485         request.setAttribute("runTest", "testSizeTagNamePropertyMapSessionScopeNested");
486         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
487         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
488         sbft.setMap(map);
489         sbft2.setNestedObject(sbft);
490         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
491         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
492     }
493     public void endSizeTagNamePropertyMapSessionScopeNested(WebResponse response){
494         formatAndTest("3", response.getText());
495     }
496
497     public void testSizeTagNamePropertyMapRequestScopeNested() throws IOException JavaDoc, ServletException JavaDoc{
498         request.setAttribute("runTest", "testSizeTagNamePropertyMapRequestScopeNested");
499         SimpleBeanForTesting sbft = new SimpleBeanForTesting();
500         SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
501         sbft.setMap(map);
502         sbft2.setNestedObject(sbft);
503         pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
504         pageContext.forward("/test/org/apache/struts/taglib/bean/TestSizeTag.jsp");
505     }
506     public void endSizeTagNamePropertyMapRequestScopeNested(WebResponse response){
507         formatAndTest("3", response.getText());
508     }
509
510
511 }
512
Popular Tags