~ubuntu-branches/ubuntu/lucid/libstruts1.2-java/lucid

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-04-24 12:14:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060424121423-naev53qigqgks0sa
Tags: 1.2.9-1
New upstream  release Fixes  three security  problems: CVE-2006-1546,
CVE-2006-1547,  CVE-2006-1548  (closes:  #360551),  thanks  to  Moritz
Muehlenhoff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: TestSubmitTag1.java 54929 2004-10-16 16:38:42Z germuska $ 
 
3
 *
 
4
 * Copyright 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;
 
21
 
 
22
import javax.servlet.jsp.PageContext;
 
23
import junit.framework.Test;
 
24
import junit.framework.TestSuite;
 
25
 
 
26
import org.apache.cactus.JspTestCase;
 
27
import org.apache.struts.Globals;
 
28
 
 
29
/**
 
30
 * Suite of unit tests for the
 
31
 * <code>org.apache.struts.taglib.html.SubmitTag</code> class.
 
32
 *
 
33
 */
 
34
public class TestSubmitTag1 extends JspTestCase {
 
35
 
 
36
    /**
 
37
     * Defines the testcase name for JUnit.
 
38
     *
 
39
     * @param theName the testcase's name.
 
40
     */
 
41
    public TestSubmitTag1(String theName) {
 
42
        super(theName);
 
43
    }
 
44
 
 
45
    /**
 
46
     * Start the tests.
 
47
     *
 
48
     * @param theArgs the arguments. Not used
 
49
     */
 
50
    public static void main(String[] theArgs) {
 
51
        junit.awtui.TestRunner.main(new String[] {TestSubmitTag1.class.getName()});
 
52
    }
 
53
 
 
54
    /**
 
55
     * @return a test suite (<code>TestSuite</code>) that includes all methods
 
56
     *         starting with "test"
 
57
     */
 
58
    public static Test suite() {
 
59
        // All methods starting with "test" will be executed in the test suite.
 
60
        return new TestSuite(TestSubmitTag1.class);
 
61
    }
 
62
 
 
63
    private void runMyTest(String whichTest, String locale) throws Exception {
 
64
        pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
 
65
        request.setAttribute("runTest", whichTest);
 
66
        pageContext.forward("/test/org/apache/struts/taglib/html/TestSubmitTag1.jsp");    }
 
67
 
 
68
    /*
 
69
     * Testing SubmitTag.
 
70
     */
 
71
    public void testSubmitProperty() throws Exception {
 
72
        runMyTest("testSubmitProperty", "");
 
73
    }
 
74
    public void testSubmitPropertyAccesskey() throws Exception {
 
75
        runMyTest("testSubmitPropertyAccesskey", "");
 
76
    }
 
77
    public void testSubmitPropertyAlt() throws Exception {
 
78
        runMyTest("testSubmitPropertyAlt", "");
 
79
    }
 
80
    public void testSubmitPropertyAltKey1() throws Exception {
 
81
        runMyTest("testSubmitPropertyAltKey1", "");
 
82
    }
 
83
    public void testSubmitPropertyAltKey2() throws Exception {
 
84
        runMyTest("testSubmitPropertyAltKey2", "");
 
85
    }
 
86
    public void testSubmitPropertyAltKey3() throws Exception {
 
87
        runMyTest("testSubmitPropertyAltKey3", "");
 
88
    }
 
89
    public void testSubmitPropertyAltKey_fr1() throws Exception {
 
90
        runMyTest("testSubmitPropertyAltKey1_fr", "fr");
 
91
    }
 
92
    public void testSubmitPropertyAltKey_fr2() throws Exception {
 
93
        runMyTest("testSubmitPropertyAltKey2_fr", "fr");
 
94
    }
 
95
    public void testSubmitPropertyDisabled_True() throws Exception {
 
96
        runMyTest("testSubmitPropertyDisabled_True", "");
 
97
    }
 
98
    public void testSubmitPropertyDisabled_False1() throws Exception {
 
99
        runMyTest("testSubmitPropertyDisabled_False1", "");
 
100
    }
 
101
    public void testSubmitPropertyDisabled_False2() throws Exception {
 
102
        runMyTest("testSubmitPropertyDisabled_False2", "");
 
103
    }
 
104
    public void testSubmitPropertyOnblur() throws Exception {
 
105
        runMyTest("testSubmitPropertyOnblur", "");
 
106
    }
 
107
    public void testSubmitPropertyOnchange() throws Exception {
 
108
        runMyTest("testSubmitPropertyOnchange", "");
 
109
    }
 
110
    public void testSubmitPropertyOnclick() throws Exception {
 
111
        runMyTest("testSubmitPropertyOnclick", "");
 
112
    }
 
113
    public void testSubmitPropertyOndblclick() throws Exception {
 
114
        runMyTest("testSubmitPropertyOndblclick", "");
 
115
    }
 
116
    public void testSubmitPropertyOnfocus() throws Exception {
 
117
        runMyTest("testSubmitPropertyOnfocus", "");
 
118
    }
 
119
    public void testSubmitPropertyOnkeydown() throws Exception {
 
120
        runMyTest("testSubmitPropertyOnkeydown", "");
 
121
    }
 
122
    public void testSubmitPropertyOnkeypress() throws Exception {
 
123
        runMyTest("testSubmitPropertyOnkeypress", "");
 
124
    }
 
125
    public void testSubmitPropertyOnkeyup() throws Exception {
 
126
        runMyTest("testSubmitPropertyOnkeyup", "");
 
127
    }
 
128
    public void testSubmitPropertyOnmousedown() throws Exception {
 
129
        runMyTest("testSubmitPropertyOnmousedown", "");
 
130
    }
 
131
    public void testSubmitPropertyOnmousemove() throws Exception {
 
132
        runMyTest("testSubmitPropertyOnmousemove", "");
 
133
    }
 
134
    public void testSubmitPropertyOnmouseout() throws Exception {
 
135
        runMyTest("testSubmitPropertyOnmouseout", "");
 
136
    }
 
137
    public void testSubmitPropertyOnmouseover() throws Exception {
 
138
        runMyTest("testSubmitPropertyOnmouseover", "");
 
139
    }
 
140
    public void testSubmitPropertyOnmouseup() throws Exception {
 
141
        runMyTest("testSubmitPropertyOnmouseup", "");
 
142
    }
 
143
 
 
144
}