KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: TestCancelTag2.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.CancelTag</code> class.
32  *
33  */

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

41     public TestCancelTag2(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[] {TestCancelTag2.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(TestCancelTag2.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/TestCancelTag2.jsp");
67     }
68
69     /*
70      * Testing CancelTag.
71      */

72
73     public void testCancelStyle() throws Exception JavaDoc {
74         runMyTest("testCancelStyle", "");
75         }
76
77     public void testCancelStyleClass() throws Exception JavaDoc {
78         runMyTest("testCancelStyleClass", "");
79         }
80
81     public void testCancelStyleId() throws Exception JavaDoc {
82         runMyTest("testCancelStyleId", "");
83         }
84
85     public void testCancelTabindex() throws Exception JavaDoc {
86         runMyTest("testCancelTabindex", "");
87         }
88
89     public void testCancelTitle() throws Exception JavaDoc {
90         runMyTest("testCancelTitle", "");
91         }
92
93     public void testCancelTitleKey() throws Exception JavaDoc {
94         runMyTest("testCancelTitleKey", "");
95         }
96
97     public void testCancelTitleKey_fr() throws Exception JavaDoc {
98         runMyTest("testCancelTitleKey_fr", "fr");
99         }
100
101     public void testCancelValue() throws Exception JavaDoc {
102         runMyTest("testCancelValue", "");
103         }
104
105     public void testCancelBodyContent() throws Exception JavaDoc {
106         runMyTest("testCancelBodyContent", "");
107         }
108
109     public void testCancelBodyContentMessageKey() throws Exception JavaDoc {
110         runMyTest("testCancelBodyContentMessageKey", "");
111         }
112
113     public void testCancelBodyContentMessageKey_fr() throws Exception JavaDoc {
114         runMyTest("testCancelBodyContentMessageKey_fr", "fr");
115         }
116
117 }
118
Popular Tags