~ubuntu-branches/ubuntu/trusty/libstruts1.2-java/trusty-proposed

« back to all changes in this revision

Viewing changes to src/test/org/apache/struts/taglib/html/TestHtmlTag.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 15:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20041119153525-mdu08a76z4zo67xt
Tags: upstream-1.2.4
ImportĀ upstreamĀ versionĀ 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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 $
 
3
 * $Revision: 1.8 $
 
4
 * $Date: 2004/03/14 06:23:41 $
 
5
 *
 
6
 * Copyright 1999-2004 The Apache Software Foundation.
 
7
 * 
 
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
 
11
 * 
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 * 
 
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.
 
19
 */
 
20
package org.apache.struts.taglib.html;
 
21
 
 
22
import java.util.Locale;
 
23
 
 
24
import javax.servlet.jsp.PageContext;
 
25
import junit.framework.Test;
 
26
import junit.framework.TestSuite;
 
27
 
 
28
import org.apache.cactus.JspTestCase;
 
29
import org.apache.struts.Globals;
 
30
import org.apache.struts.taglib.SimpleBeanForTesting;
 
31
 
 
32
/**
 
33
 * Suite of unit tests for the
 
34
 * <code>org.apache.struts.taglib.html.HtmlTag</code> class.
 
35
 *
 
36
 */
 
37
public class TestHtmlTag extends JspTestCase {
 
38
 
 
39
    /**
 
40
     * Defines the testcase name for JUnit.
 
41
     *
 
42
     * @param theName the testcase's name.
 
43
     */
 
44
    public TestHtmlTag(String theName) {
 
45
        super(theName);
 
46
    }
 
47
 
 
48
    /**
 
49
     * Start the tests.
 
50
     *
 
51
     * @param theArgs the arguments. Not used
 
52
     */
 
53
    public static void main(String[] theArgs) {
 
54
        junit.awtui.TestRunner.main(new String[] {TestHtmlTag.class.getName()});
 
55
    }
 
56
 
 
57
    /**
 
58
     * @return a test suite (<code>TestSuite</code>) that includes all methods
 
59
     *         starting with "test"
 
60
     */
 
61
    public static Test suite() {
 
62
        // All methods starting with "test" will be executed in the test suite.
 
63
        return new TestSuite(TestHtmlTag.class);
 
64
    }
 
65
 
 
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");
 
71
    }
 
72
 
 
73
    /*
 
74
     * Testing HtmlTag.
 
75
     */
 
76
    public void testHtml() throws Exception {
 
77
        runMyTest("testHtml", "");
 
78
        }
 
79
 
 
80
    public void testHtmlLocale1() throws Exception {
 
81
        runMyTest("testHtmlLocale1", "");
 
82
        }
 
83
 
 
84
    public void testHtmlLocale2() throws Exception {
 
85
        runMyTest("testHtmlLocale2", "");
 
86
        }
 
87
 
 
88
    public void testHtmlLocale3() throws Exception {
 
89
        runMyTest("testHtmlLocale3", "");
 
90
        }
 
91
 
 
92
    public void testHtmlLocale4() throws Exception {
 
93
        runMyTest("testHtmlLocale4", "");
 
94
        }
 
95
 
 
96
    public void testHtmlLocale5() throws Exception {
 
97
        runMyTest("testHtmlLocale5", "");
 
98
        }
 
99
 
 
100
    public void testHtmlLocale6() throws Exception {
 
101
        runMyTest("testHtmlLocale6", "");
 
102
        }
 
103
 
 
104
    public void testHtmlLocale_fr1() throws Exception {
 
105
        runMyTest("testHtmlLocale_fr1", "fr");
 
106
        }
 
107
 
 
108
    public void testHtmlLocale_fr2() throws Exception {
 
109
        runMyTest("testHtmlLocale_fr2", "fr");
 
110
        }
 
111
 
 
112
    public void testHtmlLocale_fr3() throws Exception {
 
113
        runMyTest("testHtmlLocale_fr3", "fr");
 
114
        }
 
115
 
 
116
    public void testHtmlLocale_fr4() throws Exception {
 
117
        runMyTest("testHtmlLocale_fr4", "fr");
 
118
        }
 
119
 
 
120
    public void testHtmlLocale_fr5() throws Exception {
 
121
        runMyTest("testHtmlLocale_fr5", "fr");
 
122
        }
 
123
 
 
124
    public void testHtmlLocale_fr6() throws Exception {
 
125
        runMyTest("testHtmlLocale_fr6", "fr");
 
126
        }
 
127
 
 
128
    public void testHtmlXhtml1() throws Exception {
 
129
        runMyTest("testHtmlXhtml1", "");
 
130
        }
 
131
 
 
132
    public void testHtmlXhtml2() throws Exception {
 
133
        runMyTest("testHtmlXhtml2", "");
 
134
        }
 
135
 
 
136
    public void testHtmlXhtml3() throws Exception {
 
137
        runMyTest("testHtmlXhtml3", "");
 
138
        }
 
139
 
 
140
    public void testHtmlXhtml4() throws Exception {
 
141
        runMyTest("testHtmlXhtml4", "");
 
142
        }
 
143
 
 
144
    public void testHtmlXhtml5() throws Exception {
 
145
        runMyTest("testHtmlXhtml5", "");
 
146
        }
 
147
 
 
148
    public void testHtmlXhtml6() throws Exception {
 
149
        runMyTest("testHtmlXhtml6", "");
 
150
        }
 
151
 
 
152
    public void testHtmlLocaleXhtml1() throws Exception {
 
153
        runMyTest("testHtmlLocaleXhtml1", "");
 
154
        }
 
155
 
 
156
    public void testHtmlLocaleXhtml2() throws Exception {
 
157
        runMyTest("testHtmlLocaleXhtml2", "");
 
158
        }
 
159
 
 
160
    public void testHtmlLocaleXhtml3() throws Exception {
 
161
        runMyTest("testHtmlLocaleXhtml3", "");
 
162
        }
 
163
 
 
164
    public void testHtmlLocaleXhtml_fr1() throws Exception {
 
165
        runMyTest("testHtmlLocaleXhtml_fr1", "fr");
 
166
        }
 
167
 
 
168
    public void testHtmlLocaleXhtml_fr2() throws Exception {
 
169
        runMyTest("testHtmlLocaleXhtml_fr2", "fr");
 
170
        }
 
171
 
 
172
    public void testHtmlLocaleXhtml_fr3() throws Exception {
 
173
        runMyTest("testHtmlLocaleXhtml_fr3", "fr");
 
174
        }
 
175
 
 
176
 
 
177
}