2
* $Header: /home/cvs/jakarta-struts/src/test/org/apache/struts/taglib/html/TestHtmlTag.java,v 1.8 2004/03/14 06:23:41 sraeburn Exp $
4
* $Date: 2004/03/14 06:23:41 $
6
* Copyright 1999-2004 The Apache Software Foundation.
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
20
package org.apache.struts.taglib.html;
22
import java.util.Locale;
24
import javax.servlet.jsp.PageContext;
25
import junit.framework.Test;
26
import junit.framework.TestSuite;
28
import org.apache.cactus.JspTestCase;
29
import org.apache.struts.Globals;
30
import org.apache.struts.taglib.SimpleBeanForTesting;
33
* Suite of unit tests for the
34
* <code>org.apache.struts.taglib.html.HtmlTag</code> class.
37
public class TestHtmlTag extends JspTestCase {
40
* Defines the testcase name for JUnit.
42
* @param theName the testcase's name.
44
public TestHtmlTag(String theName) {
51
* @param theArgs the arguments. Not used
53
public static void main(String[] theArgs) {
54
junit.awtui.TestRunner.main(new String[] {TestHtmlTag.class.getName()});
58
* @return a test suite (<code>TestSuite</code>) that includes all methods
59
* starting with "test"
61
public static Test suite() {
62
// All methods starting with "test" will be executed in the test suite.
63
return new TestSuite(TestHtmlTag.class);
66
private void runMyTest(String whichTest, String locale) throws Exception {
67
pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
68
pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting("Test Value"), PageContext.REQUEST_SCOPE);
69
request.setAttribute("runTest", whichTest);
70
pageContext.forward("/test/org/apache/struts/taglib/html/TestHtmlTag.jsp");
76
public void testHtml() throws Exception {
77
runMyTest("testHtml", "");
80
public void testHtmlLocale1() throws Exception {
81
runMyTest("testHtmlLocale1", "");
84
public void testHtmlLocale2() throws Exception {
85
runMyTest("testHtmlLocale2", "");
88
public void testHtmlLocale3() throws Exception {
89
runMyTest("testHtmlLocale3", "");
92
public void testHtmlLocale4() throws Exception {
93
runMyTest("testHtmlLocale4", "");
96
public void testHtmlLocale5() throws Exception {
97
runMyTest("testHtmlLocale5", "");
100
public void testHtmlLocale6() throws Exception {
101
runMyTest("testHtmlLocale6", "");
104
public void testHtmlLocale_fr1() throws Exception {
105
runMyTest("testHtmlLocale_fr1", "fr");
108
public void testHtmlLocale_fr2() throws Exception {
109
runMyTest("testHtmlLocale_fr2", "fr");
112
public void testHtmlLocale_fr3() throws Exception {
113
runMyTest("testHtmlLocale_fr3", "fr");
116
public void testHtmlLocale_fr4() throws Exception {
117
runMyTest("testHtmlLocale_fr4", "fr");
120
public void testHtmlLocale_fr5() throws Exception {
121
runMyTest("testHtmlLocale_fr5", "fr");
124
public void testHtmlLocale_fr6() throws Exception {
125
runMyTest("testHtmlLocale_fr6", "fr");
128
public void testHtmlXhtml1() throws Exception {
129
runMyTest("testHtmlXhtml1", "");
132
public void testHtmlXhtml2() throws Exception {
133
runMyTest("testHtmlXhtml2", "");
136
public void testHtmlXhtml3() throws Exception {
137
runMyTest("testHtmlXhtml3", "");
140
public void testHtmlXhtml4() throws Exception {
141
runMyTest("testHtmlXhtml4", "");
144
public void testHtmlXhtml5() throws Exception {
145
runMyTest("testHtmlXhtml5", "");
148
public void testHtmlXhtml6() throws Exception {
149
runMyTest("testHtmlXhtml6", "");
152
public void testHtmlLocaleXhtml1() throws Exception {
153
runMyTest("testHtmlLocaleXhtml1", "");
156
public void testHtmlLocaleXhtml2() throws Exception {
157
runMyTest("testHtmlLocaleXhtml2", "");
160
public void testHtmlLocaleXhtml3() throws Exception {
161
runMyTest("testHtmlLocaleXhtml3", "");
164
public void testHtmlLocaleXhtml_fr1() throws Exception {
165
runMyTest("testHtmlLocaleXhtml_fr1", "fr");
168
public void testHtmlLocaleXhtml_fr2() throws Exception {
169
runMyTest("testHtmlLocaleXhtml_fr2", "fr");
172
public void testHtmlLocaleXhtml_fr3() throws Exception {
173
runMyTest("testHtmlLocaleXhtml_fr3", "fr");