KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > taglib > html > TestButtonTag1


1 /*
2  * $Id: TestButtonTag1.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 1999-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 JavaDoc;
21
22 import javax.servlet.jsp.PageContext JavaDoc;
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.ButtonTag</code> class.
32  *
33  */

34 public class TestButtonTag1 extends JspTestCase {
35
36     /**
37      * Defines the testcase name for JUnit.
38      *
39      * @param theName the testcase's name.
40      */

41     public TestButtonTag1(String JavaDoc 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 JavaDoc[] theArgs) {
51         junit.awtui.TestRunner.main(new String JavaDoc[] {TestButtonTag1.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(TestButtonTag1.class);
61     }
62
63     private void runMyTest(String JavaDoc whichTest, String JavaDoc locale) throws Exception JavaDoc {
64         pageContext.setAttribute(Globals.LOCALE_KEY, new Locale JavaDoc(locale, locale), PageContext.SESSION_SCOPE);
65         request.setAttribute("runTest", whichTest);
66         pageContext.forward("/test/org/apache/struts/taglib/html/TestButtonTag1.jsp"); }
67
68     /*
69      * Testing ButtonTag.
70      */

71     public void testButtonProperty() throws Exception JavaDoc {
72         runMyTest("testButtonProperty", "");
73         }
74     public void testButtonPropertyAccesskey() throws Exception JavaDoc {
75         runMyTest("testButtonPropertyAccesskey", "");
76         }
77     public void testButtonPropertyAlt() throws Exception JavaDoc {
78         runMyTest("testButtonPropertyAlt", "");
79         }
80     public void testButtonPropertyAltKey1() throws Exception JavaDoc {
81         runMyTest("testButtonPropertyAltKey1", "");
82         }
83     public void testButtonPropertyAltKey2() throws Exception JavaDoc {
84         runMyTest("testButtonPropertyAltKey2", "");
85         }
86     public void testButtonPropertyAltKey3() throws Exception JavaDoc {
87         runMyTest("testButtonPropertyAltKey3", "");
88     }
89     public void testButtonPropertyAltKey_fr1() throws Exception JavaDoc {
90         runMyTest("testButtonPropertyAltKey1_fr", "fr");
91         }
92     public void testButtonPropertyAltKey_fr2() throws Exception JavaDoc {
93         runMyTest("testButtonPropertyAltKey2_fr", "fr");
94         }
95     public void testButtonPropertyDisabled_True() throws Exception JavaDoc {
96         runMyTest("testButtonPropertyDisabled_True", "");
97         }
98     public void testButtonPropertyDisabled_False1() throws Exception JavaDoc {
99         runMyTest("testButtonPropertyDisabled_False1", "");
100         }
101     public void testButtonPropertyDisabled_False2() throws Exception JavaDoc {
102         runMyTest("testButtonPropertyDisabled_False2", "");
103         }
104     public void testButtonPropertyOnblur() throws Exception JavaDoc {
105         runMyTest("testButtonPropertyOnblur", "");
106         }
107
108     public void testButtonPropertyOnchange() throws Exception JavaDoc {
109         runMyTest("testButtonPropertyOnchange", "");
110         }
111
112     public void testButtonPropertyOnclick() throws Exception JavaDoc {
113         runMyTest("testButtonPropertyOnclick", "");
114         }
115
116     public void testButtonPropertyOndblclick() throws Exception JavaDoc {
117         runMyTest("testButtonPropertyOndblclick", "");
118         }
119
120     public void testButtonPropertyOnfocus() throws Exception JavaDoc {
121         runMyTest("testButtonPropertyOnfocus", "");
122         }
123
124     public void testButtonPropertyOnkeydown() throws Exception JavaDoc {
125         runMyTest("testButtonPropertyOnkeydown", "");
126         }
127
128     public void testButtonPropertyOnkeypress() throws Exception JavaDoc {
129         runMyTest("testButtonPropertyOnkeypress", "");
130         }
131
132     public void testButtonPropertyOnkeyup() throws Exception JavaDoc {
133         runMyTest("testButtonPropertyOnkeyup", "");
134         }
135
136     public void testButtonPropertyOnmousedown() throws Exception JavaDoc {
137         runMyTest("testButtonPropertyOnmousedown", "");
138         }
139
140     public void testButtonPropertyOnmousemove() throws Exception JavaDoc {
141         runMyTest("testButtonPropertyOnmousemove", "");
142         }
143
144     public void testButtonPropertyOnmouseout() throws Exception JavaDoc {
145         runMyTest("testButtonPropertyOnmouseout", "");
146         }
147
148     public void testButtonPropertyOnmouseover() throws Exception JavaDoc {
149         runMyTest("testButtonPropertyOnmouseover", "");
150         }
151
152     public void testButtonPropertyOnmouseup() throws Exception JavaDoc {
153         runMyTest("testButtonPropertyOnmouseup", "");
154         }
155
156 }
157
Popular Tags