KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: TestResetTag2.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.ArrayList JavaDoc;
21 import java.util.HashMap JavaDoc;
22 import java.util.Locale JavaDoc;
23 import java.util.StringTokenizer JavaDoc;
24
25 import javax.servlet.jsp.PageContext JavaDoc;
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.ResetTag</code> class.
36  *
37  */

38 public class TestResetTag2 extends JspTestCase {
39
40     /**
41      * Defines the testcase name for JUnit.
42      *
43      * @param theName the testcase's name.
44      */

45     public TestResetTag2(String JavaDoc 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 JavaDoc[] theArgs) {
55         junit.awtui.TestRunner.main(new String JavaDoc[] {TestResetTag2.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(TestResetTag2.class);
65     }
66
67     private void runMyTest(String JavaDoc whichTest, String JavaDoc locale) throws Exception JavaDoc {
68         pageContext.setAttribute(Globals.LOCALE_KEY, new Locale JavaDoc(locale, locale), PageContext.SESSION_SCOPE);
69         request.setAttribute("runTest", whichTest);
70         pageContext.forward("/test/org/apache/struts/taglib/html/TestResetTag2.jsp");
71     }
72
73     /*
74      * Testing ResetTag.
75      */

76
77     public void testResetPropertyStyle() throws Exception JavaDoc {
78         runMyTest("testResetPropertyStyle", "");
79     }
80     public void testResetPropertyStyleClass() throws Exception JavaDoc {
81         runMyTest("testResetPropertyStyleClass", "");
82     }
83     public void testResetPropertyStyleId() throws Exception JavaDoc {
84         runMyTest("testResetPropertyStyleId", "");
85     }
86     public void testResetPropertyTabindex() throws Exception JavaDoc {
87         runMyTest("testResetPropertyTabindex", "");
88     }
89     public void testResetPropertyTitle() throws Exception JavaDoc {
90         runMyTest("testResetPropertyTitle", "");
91     }
92     public void testResetPropertyTitleKey() throws Exception JavaDoc {
93         runMyTest("testResetPropertyTitleKey", "");
94     }
95     public void testResetPropertyTitleKey_fr() throws Exception JavaDoc {
96         runMyTest("testResetPropertyTitleKey_fr", "fr");
97     }
98     public void testResetPropertyValue() throws Exception JavaDoc {
99         runMyTest("testResetPropertyValue", "");
100     }
101     public void testResetPropertyBodyContent() throws Exception JavaDoc {
102         runMyTest("testResetPropertyBodyContent", "");
103     }
104     public void testResetPropertyBodyContentMessageKey() throws Exception JavaDoc {
105         runMyTest("testResetPropertyBodyContentMessageKey", "");
106     }
107     public void testResetPropertyBodyContentMessageKey_fr() throws Exception JavaDoc {
108         runMyTest("testResetPropertyBodyContentMessageKey_fr", "fr");
109     }
110
111 }
112
Popular Tags