2
* $Header: /home/cvs/jakarta-struts/src/test/org/apache/struts/taglib/html/TestCancelTag2.java,v 1.9 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;
32
* Suite of unit tests for the
33
* <code>org.apache.struts.taglib.html.CancelTag</code> class.
36
public class TestCancelTag2 extends JspTestCase {
39
* Defines the testcase name for JUnit.
41
* @param theName the testcase's name.
43
public TestCancelTag2(String theName) {
50
* @param theArgs the arguments. Not used
52
public static void main(String[] theArgs) {
53
junit.awtui.TestRunner.main(new String[] {TestCancelTag2.class.getName()});
57
* @return a test suite (<code>TestSuite</code>) that includes all methods
58
* starting with "test"
60
public static Test suite() {
61
// All methods starting with "test" will be executed in the test suite.
62
return new TestSuite(TestCancelTag2.class);
65
private void runMyTest(String whichTest, String locale) throws Exception {
66
pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
67
request.setAttribute("runTest", whichTest);
68
pageContext.forward("/test/org/apache/struts/taglib/html/TestCancelTag2.jsp");
75
public void testCancelStyle() throws Exception {
76
runMyTest("testCancelStyle", "");
79
public void testCancelStyleClass() throws Exception {
80
runMyTest("testCancelStyleClass", "");
83
public void testCancelStyleId() throws Exception {
84
runMyTest("testCancelStyleId", "");
87
public void testCancelTabindex() throws Exception {
88
runMyTest("testCancelTabindex", "");
91
public void testCancelTitle() throws Exception {
92
runMyTest("testCancelTitle", "");
95
public void testCancelTitleKey() throws Exception {
96
runMyTest("testCancelTitleKey", "");
99
public void testCancelTitleKey_fr() throws Exception {
100
runMyTest("testCancelTitleKey_fr", "fr");
103
public void testCancelValue() throws Exception {
104
runMyTest("testCancelValue", "");
107
public void testCancelBodyContent() throws Exception {
108
runMyTest("testCancelBodyContent", "");
111
public void testCancelBodyContentMessageKey() throws Exception {
112
runMyTest("testCancelBodyContentMessageKey", "");
115
public void testCancelBodyContentMessageKey_fr() throws Exception {
116
runMyTest("testCancelBodyContentMessageKey_fr", "fr");