KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > taglib > html > TestHtmlTag


1 /*
2  * $Id: TestHtmlTag.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.html;
19
20 import java.util.Locale JavaDoc;
21
22 import javax.servlet.jsp.PageContext JavaDoc;
23 import junit.framework.Test;
24 import junit.framework.TestSuite;
25
26 import org.apache.cactus.JspTestCase;
27 import org.apache.struts.Globals;
28 import org.apache.struts.taglib.SimpleBeanForTesting;
29
30 /**
31  * Suite of unit tests for the
32  * <code>org.apache.struts.taglib.html.HtmlTag</code> class.
33  *
34  */

35 public class TestHtmlTag extends JspTestCase {
36
37     /**
38      * Defines the testcase name for JUnit.
39      *
40      * @param theName the testcase's name.
41      */

42     public TestHtmlTag(String JavaDoc theName) {
43         super(theName);
44     }
45
46     /**
47      * Start the tests.
48      *
49      * @param theArgs the arguments. Not used
50      */

51     public static void main(String JavaDoc[] theArgs) {
52         junit.awtui.TestRunner.main(new String JavaDoc[] {TestHtmlTag.class.getName()});
53     }
54
55     /**
56      * @return a test suite (<code>TestSuite</code>) that includes all methods
57      * starting with "test"
58      */

59     public static Test suite() {
60         // All methods starting with "test" will be executed in the test suite.
61
return new TestSuite(TestHtmlTag.class);
62     }
63
64     private void runMyTest(String JavaDoc whichTest, String JavaDoc locale) throws Exception JavaDoc {
65         pageContext.setAttribute(Globals.LOCALE_KEY, new Locale JavaDoc(locale, locale), PageContext.SESSION_SCOPE);
66         pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting("Test Value"), PageContext.REQUEST_SCOPE);
67         request.setAttribute("runTest", whichTest);
68         pageContext.forward("/test/org/apache/struts/taglib/html/TestHtmlTag.jsp");
69     }
70
71     /*
72      * Testing HtmlTag.
73      */

74     public void testHtml() throws Exception JavaDoc {
75         runMyTest("testHtml", "");
76         }
77
78     public void testHtmlLocale1() throws Exception JavaDoc {
79         runMyTest("testHtmlLocale1", "");
80         }
81
82     public void testHtmlLocale2() throws Exception JavaDoc {
83         runMyTest("testHtmlLocale2", "");
84         }
85
86     public void testHtmlLocale3() throws Exception JavaDoc {
87         runMyTest("testHtmlLocale3", "");
88         }
89
90     public void testHtmlLocale4() throws Exception JavaDoc {
91         runMyTest("testHtmlLocale4", "");
92         }
93
94     public void testHtmlLocale5() throws Exception JavaDoc {
95         runMyTest("testHtmlLocale5", "");
96         }
97
98     public void testHtmlLocale6() throws Exception JavaDoc {
99         runMyTest("testHtmlLocale6", "");
100         }
101
102     public void testHtmlLocale_fr1() throws Exception JavaDoc {
103         runMyTest("testHtmlLocale_fr1", "fr");
104         }
105
106     public void testHtmlLocale_fr2() throws Exception JavaDoc {
107         runMyTest("testHtmlLocale_fr2", "fr");
108         }
109
110     public void testHtmlLocale_fr3() throws Exception JavaDoc {
111         runMyTest("testHtmlLocale_fr3", "fr");
112         }
113
114     public void testHtmlLocale_fr4() throws Exception JavaDoc {
115         runMyTest("testHtmlLocale_fr4", "fr");
116         }
117
118     public void testHtmlLocale_fr5() throws Exception JavaDoc {
119         runMyTest("testHtmlLocale_fr5", "fr");
120         }
121
122     public void testHtmlLocale_fr6() throws Exception JavaDoc {
123         runMyTest("testHtmlLocale_fr6", "fr");
124         }
125
126     public void testHtmlXhtml1() throws Exception JavaDoc {
127         runMyTest("testHtmlXhtml1", "");
128         }
129
130     public void testHtmlXhtml2() throws Exception JavaDoc {
131         runMyTest("testHtmlXhtml2", "");
132         }
133
134     public void testHtmlXhtml3() throws Exception JavaDoc {
135         runMyTest("testHtmlXhtml3", "");
136         }
137
138     public void testHtmlXhtml4() throws Exception JavaDoc {
139         runMyTest("testHtmlXhtml4", "");
140         }
141
142     public void testHtmlXhtml5() throws Exception JavaDoc {
143         runMyTest("testHtmlXhtml5", "");
144         }
145
146     public void testHtmlXhtml6() throws Exception JavaDoc {
147         runMyTest("testHtmlXhtml6", "");
148         }
149
150     public void testHtmlLocaleXhtml1() throws Exception JavaDoc {
151         runMyTest("testHtmlLocaleXhtml1", "");
152         }
153
154     public void testHtmlLocaleXhtml2() throws Exception JavaDoc {
155         runMyTest("testHtmlLocaleXhtml2", "");
156         }
157
158     public void testHtmlLocaleXhtml3() throws Exception JavaDoc {
159         runMyTest("testHtmlLocaleXhtml3", "");
160         }
161
162     public void testHtmlLocaleXhtml_fr1() throws Exception JavaDoc {
163         runMyTest("testHtmlLocaleXhtml_fr1", "fr");
164         }
165
166     public void testHtmlLocaleXhtml_fr2() throws Exception JavaDoc {
167         runMyTest("testHtmlLocaleXhtml_fr2", "fr");
168         }
169
170     public void testHtmlLocaleXhtml_fr3() throws Exception JavaDoc {
171         runMyTest("testHtmlLocaleXhtml_fr3", "fr");
172         }
173
174
175 }
176
Popular Tags