~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/TestImageTag1.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/TestImageTag1.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
 
 
26
import junit.framework.Test;
 
27
import junit.framework.TestSuite;
 
28
 
 
29
import org.apache.cactus.JspTestCase;
 
30
import org.apache.struts.Globals;
 
31
import org.apache.struts.taglib.SimpleBeanForTesting;
 
32
 
 
33
/**
 
34
 * Suite of unit tests for the
 
35
 * <code>org.apache.struts.taglib.html.ImageTag</code> class.
 
36
 *
 
37
 */
 
38
public class TestImageTag1 extends JspTestCase {
 
39
 
 
40
    /**
 
41
     * Defines the testcase name for JUnit.
 
42
     *
 
43
     * @param theName the testcase's name.
 
44
     */
 
45
    public TestImageTag1(String theName) {
 
46
        super(theName);
 
47
    }
 
48
 
 
49
    /**
 
50
     * Start the tests.
 
51
     *
 
52
     * @param theArgs the arguments. Not used
 
53
     */
 
54
    public static void main(String[] theArgs) {
 
55
        junit.awtui.TestRunner.main(new String[] {TestImageTag1.class.getName()});
 
56
    }
 
57
 
 
58
    /**
 
59
     * @return a test suite (<code>TestSuite</code>) that includes all methods
 
60
     *         starting with "test"
 
61
     */
 
62
    public static Test suite() {
 
63
        // All methods starting with "test" will be executed in the test suite.
 
64
        return new TestSuite(TestImageTag1.class);
 
65
    }
 
66
 
 
67
    private void runMyTest(String whichTest, String locale) throws Exception {
 
68
        pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
 
69
        pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting("Test Value"), PageContext.REQUEST_SCOPE);
 
70
        request.setAttribute("runTest", whichTest);
 
71
        pageContext.forward("/test/org/apache/struts/taglib/html/TestImageTag1.jsp");
 
72
    }
 
73
 
 
74
    /*
 
75
     * Testing ImageTag.
 
76
     */
 
77
 
 
78
//--------Testing attributes using page------
 
79
 
 
80
    public void testImagePageAccesskey() throws Exception {
 
81
        runMyTest("testImagePageAccesskey", "");
 
82
    }
 
83
 
 
84
    public void testImagePageAlign() throws Exception {
 
85
        runMyTest("testImagePageAlign", "");
 
86
    }
 
87
 
 
88
    public void testImagePageAlt() throws Exception {
 
89
        runMyTest("testImagePageAlt", "");
 
90
    }
 
91
 
 
92
    public void testImagePageAltKeyDefaultBundle() throws Exception {
 
93
        runMyTest("testImagePageAltKeyDefaultBundle", "");
 
94
    }
 
95
 
 
96
    public void testImagePageAltKeyAlternateBundle() throws Exception {
 
97
        runMyTest("testImagePageAltKeyAlternateBundle", "");
 
98
    }
 
99
 
 
100
    public void testImagePageAltKeyDefaultBundle_fr() throws Exception {
 
101
        runMyTest("testImagePageAltKeyDefaultBundle_fr", "fr");
 
102
    }
 
103
 
 
104
    public void testImagePageAltKeyAlternateBundle_fr() throws Exception {
 
105
        runMyTest("testImagePageAltKeyAlternateBundle_fr", "fr");
 
106
    }
 
107
 
 
108
    public void testImagePageBorder() throws Exception {
 
109
        runMyTest("testImagePageBorder", "");
 
110
    }
 
111
 
 
112
    public void testImagePageDisabled1() throws Exception {
 
113
        runMyTest("testImagePageDisabled1", "");
 
114
    }
 
115
 
 
116
    public void testImagePageDisabled2() throws Exception {
 
117
        runMyTest("testImagePageDisabled2", "");
 
118
    }
 
119
 
 
120
    public void testImagePageDisabled3() throws Exception {
 
121
        runMyTest("testImagePageDisabled3", "");
 
122
    }
 
123
 
 
124
    public void testImagePageDisabled4() throws Exception {
 
125
        runMyTest("testImagePageDisabled4", "");
 
126
    }
 
127
 
 
128
    public void testImagePageDisabled5() throws Exception {
 
129
        runMyTest("testImagePageDisabled5", "");
 
130
    }
 
131
 
 
132
    public void testImagePageDisabled6() throws Exception {
 
133
        runMyTest("testImagePageDisabled6", "");
 
134
    }
 
135
 
 
136
    public void testImagePageLocale() throws Exception {
 
137
        pageContext.setAttribute("secret locale", new Locale("fr", "fr"), PageContext.SESSION_SCOPE);
 
138
        runMyTest("testImagePageLocale", "");
 
139
    }
 
140
 
 
141
    public void testImagePageOnblur() throws Exception {
 
142
        runMyTest("testImagePageOnblur", "");
 
143
    }
 
144
 
 
145
    public void testImagePageOnchange() throws Exception {
 
146
        runMyTest("testImagePageOnchange", "");
 
147
    }
 
148
 
 
149
    public void testImagePageOnclick() throws Exception {
 
150
        runMyTest("testImagePageOnclick", "");
 
151
    }
 
152
 
 
153
    public void testImagePageOndblclick() throws Exception {
 
154
        runMyTest("testImagePageOndblclick", "");
 
155
    }
 
156
 
 
157
    public void testImagePageOnfocus() throws Exception {
 
158
        runMyTest("testImagePageOnfocus", "");
 
159
    }
 
160
 
 
161
    public void testImagePageOnkeydown() throws Exception {
 
162
        runMyTest("testImagePageOnkeydown", "");
 
163
    }
 
164
 
 
165
    public void testImagePageOnkeypress() throws Exception {
 
166
        runMyTest("testImagePageOnkeypress", "");
 
167
    }
 
168
 
 
169
    public void testImagePageOnkeyup() throws Exception {
 
170
        runMyTest("testImagePageOnkeyup", "");
 
171
    }
 
172
 
 
173
}