KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: TestCheckboxTag3.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 import org.apache.struts.taglib.SimpleBeanForTesting;
29
30 /**
31  * Suite of unit tests for the
32  * <code>org.apache.struts.taglib.html.CheckboxTag</code> class.
33  *
34  */

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

42     public TestCheckboxTag3(String JavaDoc theName) {
43         super(theName);
44     }
45
46     /**
47      * Start the tests.
48      *
49      * @param theArgs the arguments. Not used
50      */

51     public static void main(String JavaDoc[] theArgs) {
52         junit.awtui.TestRunner.main(new String JavaDoc[] {TestCheckboxTag3.class.getName()});
53     }
54
55     /**
56      * @return a test suite (<code>TestSuite</code>) that includes all methods
57      * starting with "test"
58      */

59     public static Test suite() {
60         // All methods starting with "test" will be executed in the test suite.
61
return new TestSuite(TestCheckboxTag3.class);
62     }
63
64     private void runMyTest(String JavaDoc whichTest, String JavaDoc locale) throws Exception JavaDoc {
65         pageContext.setAttribute(Globals.LOCALE_KEY, new Locale JavaDoc(locale, locale), PageContext.SESSION_SCOPE);
66         pageContext.setAttribute(Constants.BEAN_KEY, new SimpleBeanForTesting(false), PageContext.REQUEST_SCOPE);
67         request.setAttribute("runTest", whichTest);
68         pageContext.forward("/test/org/apache/struts/taglib/html/TestCheckboxTag3.jsp");
69     }
70
71     /*
72      * Testing CheckboxTag.
73      */

74     public void testCheckboxPropertybooleanFalse() throws Exception JavaDoc {
75         runMyTest("testCheckboxPropertybooleanFalse", "");
76         }
77     public void testCheckboxPropertybooleanFalseAccesskey() throws Exception JavaDoc {
78         runMyTest("testCheckboxPropertybooleanFalseAccesskey", "");
79         }
80     public void testCheckboxPropertybooleanFalseAlt() throws Exception JavaDoc {
81         runMyTest("testCheckboxPropertybooleanFalseAlt", "");
82         }
83     public void testCheckboxPropertybooleanFalseAltKey1() throws Exception JavaDoc {
84         runMyTest("testCheckboxPropertybooleanFalseAltKey1", "");
85         }
86     public void testCheckboxPropertybooleanFalseAltKey2() throws Exception JavaDoc {
87         runMyTest("testCheckboxPropertybooleanFalseAltKey2", "");
88         }
89     public void testCheckboxPropertybooleanFalseAltKey_fr1() throws Exception JavaDoc {
90         runMyTest("testCheckboxPropertybooleanFalseAltKey1_fr", "fr");
91         }
92     public void testCheckboxPropertybooleanFalseAltKey_fr2() throws Exception JavaDoc {
93         runMyTest("testCheckboxPropertybooleanFalseAltKey2_fr", "fr");
94         }
95     public void testCheckboxPropertybooleanFalseDisabled_True() throws Exception JavaDoc {
96         runMyTest("testCheckboxPropertybooleanFalseDisabled_True", "");
97         }
98     public void testCheckboxPropertybooleanFalseDisabled_False1() throws Exception JavaDoc {
99         runMyTest("testCheckboxPropertybooleanFalseDisabled_False1", "");
100         }
101     public void testCheckboxPropertybooleanFalseDisabled_False2() throws Exception JavaDoc {
102         runMyTest("testCheckboxPropertybooleanFalseDisabled_False2", "");
103         }
104     public void testCheckboxPropertybooleanFalseOnblur() throws Exception JavaDoc {
105         runMyTest("testCheckboxPropertybooleanFalseOnblur", "");
106         }
107
108     public void testCheckboxPropertybooleanFalseOnchange() throws Exception JavaDoc {
109         runMyTest("testCheckboxPropertybooleanFalseOnchange", "");
110         }
111
112     public void testCheckboxPropertybooleanFalseOnclick() throws Exception JavaDoc {
113         runMyTest("testCheckboxPropertybooleanFalseOnclick", "");
114         }
115
116     public void testCheckboxPropertybooleanFalseOndblclick() throws Exception JavaDoc {
117         runMyTest("testCheckboxPropertybooleanFalseOndblclick", "");
118         }
119
120     public void testCheckboxPropertybooleanFalseOnfocus() throws Exception JavaDoc {
121         runMyTest("testCheckboxPropertybooleanFalseOnfocus", "");
122         }
123
124     public void testCheckboxPropertybooleanFalseOnkeydown() throws Exception JavaDoc {
125         runMyTest("testCheckboxPropertybooleanFalseOnkeydown", "");
126         }
127
128     public void testCheckboxPropertybooleanFalseOnkeypress() throws Exception JavaDoc {
129         runMyTest("testCheckboxPropertybooleanFalseOnkeypress", "");
130         }
131
132     public void testCheckboxPropertybooleanFalseOnkeyup() throws Exception JavaDoc {
133         runMyTest("testCheckboxPropertybooleanFalseOnkeyup", "");
134         }
135
136     public void testCheckboxPropertybooleanFalseOnmousedown() throws Exception JavaDoc {
137         runMyTest("testCheckboxPropertybooleanFalseOnmousedown", "");
138         }
139
140     public void testCheckboxPropertybooleanFalseOnmousemove() throws Exception JavaDoc {
141         runMyTest("testCheckboxPropertybooleanFalseOnmousemove", "");
142         }
143
144     public void testCheckboxPropertybooleanFalseOnmouseout() throws Exception JavaDoc {
145         runMyTest("testCheckboxPropertybooleanFalseOnmouseout", "");
146         }
147
148     public void testCheckboxPropertybooleanFalseOnmouseover() throws Exception JavaDoc {
149         runMyTest("testCheckboxPropertybooleanFalseOnmouseover", "");
150         }
151
152     public void testCheckboxPropertybooleanFalseOnmouseup() throws Exception JavaDoc {
153         runMyTest("testCheckboxPropertybooleanFalseOnmouseup", "");
154         }
155
156 }
157
Popular Tags