Source Code Cross Referenced for UpDownSelectTagTest.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » views » jsp » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » webwork 2.2.6 » com.opensymphony.webwork.views.jsp.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2003 by OpenSymphony
003:         * All rights reserved.
004:         */
005:        package com.opensymphony.webwork.views.jsp.ui;
006:
007:        import java.util.ArrayList;
008:        import java.util.LinkedHashMap;
009:        import java.util.List;
010:        import java.util.Map;
011:
012:        import com.opensymphony.webwork.views.jsp.AbstractUITagTest;
013:        import com.opensymphony.webwork.TestAction;
014:        import com.opensymphony.xwork.Action;
015:        import com.opensymphony.xwork.ActionSupport;
016:
017:        /**
018:         * Test case for UpDownSelectTag 
019:         * 
020:         * @author tm_jee
021:         * @version $Date: 2006-02-03 14:27:22 +0100 (Fri, 03 Feb 2006) $ $Id: UpDownSelectTagTest.java 2099 2006-02-03 13:27:22Z rgielen $
022:         */
023:        public class UpDownSelectTagTest extends AbstractUITagTest {
024:
025:            public void testWithAllSelected() throws Exception {
026:
027:                UpDownSelectTag tag = new UpDownSelectTag();
028:                tag.setPageContext(pageContext);
029:                tag.setId("myId");
030:                tag.setName("myName");
031:                tag.setList("myMap");
032:                tag.setValue("myAllSelectedMapIds");
033:                tag.setEmptyOption("true");
034:
035:                tag.doStartTag();
036:                tag.doEndTag();
037:
038:                verify(UpDownSelectTagTest.class
039:                        .getResource("updownselecttag-1.txt"));
040:            }
041:
042:            public void testWithPartialSelected() throws Exception {
043:
044:                UpDownSelectTag tag = new UpDownSelectTag();
045:                tag.setPageContext(pageContext);
046:                tag.setId("myId");
047:                tag.setName("myName");
048:                tag.setList("myMap");
049:                tag.setValue("mySelectedMapIds");
050:                tag.setEmptyOption("false");
051:
052:                tag.doStartTag();
053:                tag.doEndTag();
054:
055:                verify(UpDownSelectTagTest.class
056:                        .getResource("updownselecttag-2.txt"));
057:            }
058:
059:            public void testWithHeaderAndEmptyOption() throws Exception {
060:
061:                UpDownSelectTag tag = new UpDownSelectTag();
062:                tag.setPageContext(pageContext);
063:                tag.setId("myId");
064:                tag.setName("myName");
065:                tag.setList("myMap");
066:                tag.setValue("mySelectedMapIds");
067:                tag.setEmptyOption("true");
068:                tag.setHeaderKey("-1");
069:                tag.setHeaderValue("--- Please Order ---");
070:
071:                tag.doStartTag();
072:                tag.doEndTag();
073:
074:                verify(UpDownSelectTagTest.class
075:                        .getResource("updownselecttag-3.txt"));
076:            }
077:
078:            public void testWithHeaderOnly() throws Exception {
079:
080:                UpDownSelectTag tag = new UpDownSelectTag();
081:                tag.setPageContext(pageContext);
082:                tag.setId("myId");
083:                tag.setName("myName");
084:                tag.setList("myMap");
085:                tag.setValue("mySelectedMapIds");
086:                tag.setEmptyOption("false");
087:                tag.setHeaderKey("-1");
088:                tag.setHeaderValue("--- Please Order ---");
089:
090:                tag.doStartTag();
091:                tag.doEndTag();
092:
093:                verify(UpDownSelectTagTest.class
094:                        .getResource("updownselecttag-4.txt"));
095:            }
096:
097:            public void testWithEmptyOptionOnly() throws Exception {
098:
099:                UpDownSelectTag tag = new UpDownSelectTag();
100:                tag.setPageContext(pageContext);
101:                tag.setId("myId");
102:                tag.setName("myName");
103:                tag.setList("myMap");
104:                tag.setValue("mySelectedMapIds");
105:                tag.setEmptyOption("true");
106:
107:                tag.doStartTag();
108:                tag.doEndTag();
109:
110:                verify(UpDownSelectTagTest.class
111:                        .getResource("updownselecttag-5.txt"));
112:            }
113:
114:            public void testDisableSomeSelectAllButton() throws Exception {
115:
116:                UpDownSelectTag tag = new UpDownSelectTag();
117:                tag.setPageContext(pageContext);
118:                tag.setId("myId");
119:                tag.setName("myName");
120:                tag.setList("myMap");
121:                tag.setValue("mySelectedMapIds");
122:                tag.setEmptyOption("true");
123:                tag.setAllowSelectAll("false");
124:
125:                tag.doStartTag();
126:                tag.doEndTag();
127:
128:                verify(UpDownSelectTagTest.class
129:                        .getResource("updownselecttag-6.txt"));
130:            }
131:
132:            public void testDisableMoveUpButton() throws Exception {
133:                UpDownSelectTag tag = new UpDownSelectTag();
134:                tag.setPageContext(pageContext);
135:                tag.setId("myId");
136:                tag.setName("myName");
137:                tag.setList("myMap");
138:                tag.setValue("mySelectedMapIds");
139:                tag.setEmptyOption("true");
140:                tag.setAllowMoveUp("false");
141:
142:                tag.doStartTag();
143:                tag.doEndTag();
144:
145:                verify(UpDownSelectTagTest.class
146:                        .getResource("updownselecttag-7.txt"));
147:            }
148:
149:            public void testDisableMoveDownButton() throws Exception {
150:                UpDownSelectTag tag = new UpDownSelectTag();
151:                tag.setPageContext(pageContext);
152:                tag.setId("myId");
153:                tag.setName("myName");
154:                tag.setList("myMap");
155:                tag.setValue("mySelectedMapIds");
156:                tag.setEmptyOption("true");
157:                tag.setAllowMoveDown("false");
158:
159:                tag.doStartTag();
160:                tag.doEndTag();
161:
162:                verify(UpDownSelectTagTest.class
163:                        .getResource("updownselecttag-8.txt"));
164:            }
165:
166:            public void testChangeSelectAllButtonText() throws Exception {
167:                UpDownSelectTag tag = new UpDownSelectTag();
168:                tag.setPageContext(pageContext);
169:                tag.setId("myId");
170:                tag.setName("myName");
171:                tag.setList("myMap");
172:                tag.setValue("mySelectedMapIds");
173:                tag.setEmptyOption("true");
174:                tag.setSelectAllLabel("Select All");
175:
176:                tag.doStartTag();
177:                tag.doEndTag();
178:
179:                verify(UpDownSelectTagTest.class
180:                        .getResource("updownselecttag-9.txt"));
181:            }
182:
183:            public void testChangeMoveUpButtonText() throws Exception {
184:                UpDownSelectTag tag = new UpDownSelectTag();
185:                tag.setPageContext(pageContext);
186:                tag.setId("myId");
187:                tag.setName("myName");
188:                tag.setList("myMap");
189:                tag.setValue("mySelectedMapIds");
190:                tag.setEmptyOption("true");
191:                tag.setMoveUpLabel("Move Up");
192:
193:                tag.doStartTag();
194:                tag.doEndTag();
195:
196:                verify(UpDownSelectTagTest.class
197:                        .getResource("updownselecttag-10.txt"));
198:            }
199:
200:            public void testChangeMoveDownButtonText() throws Exception {
201:                UpDownSelectTag tag = new UpDownSelectTag();
202:                tag.setPageContext(pageContext);
203:                tag.setId("myId");
204:                tag.setName("myName");
205:                tag.setList("myMap");
206:                tag.setValue("mySelectedMapIds");
207:                tag.setEmptyOption("true");
208:                tag.setMoveDownLabel("Move Down");
209:
210:                tag.doStartTag();
211:                tag.doEndTag();
212:
213:                verify(UpDownSelectTagTest.class
214:                        .getResource("updownselecttag-11.txt"));
215:            }
216:
217:            public void testGenericSimple() throws Exception {
218:                UpDownSelectTag tag = new UpDownSelectTag();
219:                prepareTagGeneric(tag);
220:                verifyGenericProperties(tag, "simple", new String[] { "value" });
221:            }
222:
223:            public void testGenericXhtml() throws Exception {
224:                UpDownSelectTag tag = new UpDownSelectTag();
225:                prepareTagGeneric(tag);
226:                verifyGenericProperties(tag, "xhtml", new String[] { "value" });
227:            }
228:
229:            public void testGenericAjax() throws Exception {
230:                UpDownSelectTag tag = new UpDownSelectTag();
231:                prepareTagGeneric(tag);
232:                verifyGenericProperties(tag, "ajax", new String[] { "value" });
233:            }
234:
235:            private void prepareTagGeneric(UpDownSelectTag tag) {
236:                tag.setList("myMap");
237:            }
238:
239:            // ===============================
240:            public Action getAction() {
241:                return new ActionSupport() {
242:
243:                    public Map getMyMap() {
244:                        Map _myMap = new LinkedHashMap();
245:                        _myMap.put("england", "England");
246:                        _myMap.put("america", "America");
247:                        _myMap.put("australia", "Australia");
248:                        _myMap.put("germany", "Germany");
249:                        return _myMap;
250:                    }
251:
252:                    public List getMySelectedMapIds() {
253:                        List _mySelectedMapIds = new ArrayList();
254:                        _mySelectedMapIds.add("america");
255:                        _mySelectedMapIds.add("germany");
256:                        return _mySelectedMapIds;
257:                    }
258:
259:                    public List getMyAllSelectedMapIds() {
260:                        List _mySelectedMapIds = new ArrayList();
261:                        _mySelectedMapIds.add("england");
262:                        _mySelectedMapIds.add("america");
263:                        _mySelectedMapIds.add("australia");
264:                        _mySelectedMapIds.add("germany");
265:                        return _mySelectedMapIds;
266:                    }
267:                };
268:            }
269:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.