~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/TestCancelTag2.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/TestCancelTag2.java,v 1.9 2004/03/14 06:23:41 sraeburn Exp $
 
3
 * $Revision: 1.9 $
 
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
 
 
31
/**
 
32
 * Suite of unit tests for the
 
33
 * <code>org.apache.struts.taglib.html.CancelTag</code> class.
 
34
 *
 
35
 */
 
36
public class TestCancelTag2 extends JspTestCase {
 
37
 
 
38
    /**
 
39
     * Defines the testcase name for JUnit.
 
40
     *
 
41
     * @param theName the testcase's name.
 
42
     */
 
43
    public TestCancelTag2(String theName) {
 
44
        super(theName);
 
45
    }
 
46
 
 
47
    /**
 
48
     * Start the tests.
 
49
     *
 
50
     * @param theArgs the arguments. Not used
 
51
     */
 
52
    public static void main(String[] theArgs) {
 
53
        junit.awtui.TestRunner.main(new String[] {TestCancelTag2.class.getName()});
 
54
    }
 
55
 
 
56
    /**
 
57
     * @return a test suite (<code>TestSuite</code>) that includes all methods
 
58
     *         starting with "test"
 
59
     */
 
60
    public static Test suite() {
 
61
        // All methods starting with "test" will be executed in the test suite.
 
62
        return new TestSuite(TestCancelTag2.class);
 
63
    }
 
64
 
 
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");
 
69
    }
 
70
 
 
71
    /*
 
72
     * Testing CancelTag.
 
73
     */
 
74
 
 
75
    public void testCancelStyle() throws Exception {
 
76
        runMyTest("testCancelStyle", "");
 
77
        }
 
78
 
 
79
    public void testCancelStyleClass() throws Exception {
 
80
        runMyTest("testCancelStyleClass", "");
 
81
        }
 
82
 
 
83
    public void testCancelStyleId() throws Exception {
 
84
        runMyTest("testCancelStyleId", "");
 
85
        }
 
86
 
 
87
    public void testCancelTabindex() throws Exception {
 
88
        runMyTest("testCancelTabindex", "");
 
89
        }
 
90
 
 
91
    public void testCancelTitle() throws Exception {
 
92
        runMyTest("testCancelTitle", "");
 
93
        }
 
94
 
 
95
    public void testCancelTitleKey() throws Exception {
 
96
        runMyTest("testCancelTitleKey", "");
 
97
        }
 
98
 
 
99
    public void testCancelTitleKey_fr() throws Exception {
 
100
        runMyTest("testCancelTitleKey_fr", "fr");
 
101
        }
 
102
 
 
103
    public void testCancelValue() throws Exception {
 
104
        runMyTest("testCancelValue", "");
 
105
        }
 
106
 
 
107
    public void testCancelBodyContent() throws Exception {
 
108
        runMyTest("testCancelBodyContent", "");
 
109
        }
 
110
 
 
111
    public void testCancelBodyContentMessageKey() throws Exception {
 
112
        runMyTest("testCancelBodyContentMessageKey", "");
 
113
        }
 
114
 
 
115
    public void testCancelBodyContentMessageKey_fr() throws Exception {
 
116
        runMyTest("testCancelBodyContentMessageKey_fr", "fr");
 
117
        }
 
118
 
 
119
}