KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: TestImgTag5.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
24 import junit.framework.Test;
25 import junit.framework.TestSuite;
26
27 import org.apache.cactus.JspTestCase;
28 import org.apache.struts.Globals;
29 import org.apache.struts.taglib.SimpleBeanForTesting;
30
31 /**
32  * Suite of unit tests for the
33  * <code>org.apache.struts.taglib.html.ImgTag</code> class.
34  *
35  */

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

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

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

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

75
76 //--------Testing attributes using page------
77

78     public void testImgSrcAlign1() throws Exception JavaDoc {
79         runMyTest("testImgSrcAlign1", "");
80     }
81
82     public void testImgSrcAlign2() throws Exception JavaDoc {
83         runMyTest("testImgSrcAlign2", "");
84     }
85
86     public void testImgSrcAlign3() throws Exception JavaDoc {
87         runMyTest("testImgSrcAlign3", "");
88     }
89
90     public void testImgSrcAlign4() throws Exception JavaDoc {
91         runMyTest("testImgSrcAlign4", "");
92     }
93
94     public void testImgSrcAlign5() throws Exception JavaDoc {
95         runMyTest("testImgSrcAlign5", "");
96     }
97
98     public void testImgSrcAlign6() throws Exception JavaDoc {
99         runMyTest("testImgSrcAlign6", "");
100     }
101
102     public void testImgSrcAlign7() throws Exception JavaDoc {
103         runMyTest("testImgSrcAlign7", "");
104     }
105
106     public void testImgSrcAlign8() throws Exception JavaDoc {
107         runMyTest("testImgSrcAlign8", "");
108     }
109
110     public void testImgSrcAlign9() throws Exception JavaDoc {
111         runMyTest("testImgSrcAlign9", "");
112     }
113
114     public void testImgSrcAlign10() throws Exception JavaDoc {
115         runMyTest("testImgSrcAlign10", "");
116     }
117
118     public void testImgSrcAlt() throws Exception JavaDoc {
119         runMyTest("testImgSrcAlt", "");
120     }
121
122     public void testImgSrcAltKeyDefaultBundle() throws Exception JavaDoc {
123         runMyTest("testImgSrcAltKeyDefaultBundle", "");
124     }
125
126     public void testImgSrcAltKeyAlternateBundle() throws Exception JavaDoc {
127         runMyTest("testImgSrcAltKeyAlternateBundle", "");
128     }
129
130     public void testImgSrcAltKeyDefaultBundle_fr() throws Exception JavaDoc {
131         runMyTest("testImgSrcAltKeyDefaultBundle_fr", "fr");
132     }
133
134     public void testImgSrcAltKeyAlternateBundle_fr() throws Exception JavaDoc {
135         runMyTest("testImgSrcAltKeyAlternateBundle_fr", "fr");
136     }
137
138     public void testImgSrcBorder() throws Exception JavaDoc {
139         runMyTest("testImgSrcBorder", "");
140     }
141
142     public void testImgSrcHeight1() throws Exception JavaDoc {
143         runMyTest("testImgSrcHeight1", "");
144     }
145
146     public void testImgSrcHeight2() throws Exception JavaDoc {
147         runMyTest("testImgSrcHeight2", "");
148     }
149
150     public void testImgSrcHspace() throws Exception JavaDoc {
151         runMyTest("testImgSrcHspace", "");
152     }
153
154     public void testImgSrcImageName() throws Exception JavaDoc {
155         runMyTest("testImgSrcImageName", "");
156     }
157
158     public void testImgSrcImageIsmap() throws Exception JavaDoc {
159         runMyTest("testImgSrcImageIsmap", "");
160     }
161
162     public void testImgSrcLocale() throws Exception JavaDoc {
163         pageContext.setAttribute("secret locale", new Locale JavaDoc("fr", "fr"), PageContext.SESSION_SCOPE);
164         runMyTest("testImgSrcLocale", "");
165     }
166
167
168
169
170 }
171
Popular Tags