Source Code Cross Referenced for MockExternalContext.java in  » J2EE » fleXive » com » flexive » tests » embedded » jsf » util » 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 » fleXive » com.flexive.tests.embedded.jsf.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /***************************************************************
002:         *  This file is part of the [fleXive](R) project.
003:         *
004:         *  Copyright (c) 1999-2007
005:         *  UCS - unique computing solutions gmbh (http://www.ucs.at)
006:         *  All rights reserved
007:         *
008:         *  The [fleXive](R) project is free software; you can redistribute
009:         *  it and/or modify it under the terms of the GNU General Public
010:         *  License as published by the Free Software Foundation;
011:         *  either version 2 of the License, or (at your option) any
012:         *  later version.
013:         *
014:         *  The GNU General Public License can be found at
015:         *  http://www.gnu.org/copyleft/gpl.html.
016:         *  A copy is found in the textfile GPL.txt and important notices to the
017:         *  license from the author are found in LICENSE.txt distributed with
018:         *  these libraries.
019:         *
020:         *  This library is distributed in the hope that it will be useful,
021:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
022:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
023:         *  GNU General Public License for more details.
024:         *
025:         *  For further information about UCS - unique computing solutions gmbh,
026:         *  please see the company website: http://www.ucs.at
027:         *
028:         *  For further information about [fleXive](R), please see the
029:         *  project website: http://www.flexive.org
030:         *
031:         *
032:         *  This copyright notice MUST APPEAR in all copies of the file!
033:         ***************************************************************/package com.flexive.tests.embedded.jsf.util;
034:
035:        import javax.faces.context.ExternalContext;
036:        import javax.servlet.RequestDispatcher;
037:        import javax.servlet.Servlet;
038:        import javax.servlet.ServletContext;
039:        import javax.servlet.ServletException;
040:        import java.io.IOException;
041:        import java.io.InputStream;
042:        import java.net.MalformedURLException;
043:        import java.net.URL;
044:        import java.security.Principal;
045:        import java.util.*;
046:
047:        /**
048:         * Mock external faces context for unit testing. If your code needs a method,
049:         * add a reasonable (dummy) implementation.
050:         * 
051:         * @author Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
052:         *
053:         */
054:        public class MockExternalContext extends ExternalContext {
055:            public static class MockServletContext implements  ServletContext {
056:                public void setAttribute(String s, Object o) {
057:                    //To change body of implemented methods use File | Settings | File Templates.
058:                }
059:
060:                public void removeAttribute(String s) {
061:                    //To change body of implemented methods use File | Settings | File Templates.
062:                }
063:
064:                public String getServletContextName() {
065:                    return null; //To change body of implemented methods use File | Settings | File Templates.
066:                }
067:
068:                public String getContextPath() {
069:                    return null; //To change body of implemented methods use File | Settings | File Templates.
070:                }
071:
072:                public ServletContext getContext(String s) {
073:                    return null; //To change body of implemented methods use File | Settings | File Templates.
074:                }
075:
076:                public int getMajorVersion() {
077:                    return 0; //To change body of implemented methods use File | Settings | File Templates.
078:                }
079:
080:                public int getMinorVersion() {
081:                    return 0; //To change body of implemented methods use File | Settings | File Templates.
082:                }
083:
084:                public String getMimeType(String s) {
085:                    return null; //To change body of implemented methods use File | Settings | File Templates.
086:                }
087:
088:                public Set getResourcePaths(String s) {
089:                    return null; //To change body of implemented methods use File | Settings | File Templates.
090:                }
091:
092:                public URL getResource(String s) throws MalformedURLException {
093:                    return null; //To change body of implemented methods use File | Settings | File Templates.
094:                }
095:
096:                public InputStream getResourceAsStream(String s) {
097:                    return null; //To change body of implemented methods use File | Settings | File Templates.
098:                }
099:
100:                public RequestDispatcher getRequestDispatcher(String s) {
101:                    return null; //To change body of implemented methods use File | Settings | File Templates.
102:                }
103:
104:                public RequestDispatcher getNamedDispatcher(String s) {
105:                    return null; //To change body of implemented methods use File | Settings | File Templates.
106:                }
107:
108:                public Servlet getServlet(String s) throws ServletException {
109:                    return null; //To change body of implemented methods use File | Settings | File Templates.
110:                }
111:
112:                public Enumeration getServlets() {
113:                    return null; //To change body of implemented methods use File | Settings | File Templates.
114:                }
115:
116:                public Enumeration getServletNames() {
117:                    return null; //To change body of implemented methods use File | Settings | File Templates.
118:                }
119:
120:                public void log(String s) {
121:                    //To change body of implemented methods use File | Settings | File Templates.
122:                }
123:
124:                public void log(Exception e, String s) {
125:                    //To change body of implemented methods use File | Settings | File Templates.
126:                }
127:
128:                public void log(String s, Throwable throwable) {
129:                    //To change body of implemented methods use File | Settings | File Templates.
130:                }
131:
132:                public String getRealPath(String s) {
133:                    return null; //To change body of implemented methods use File | Settings | File Templates.
134:                }
135:
136:                public String getServerInfo() {
137:                    return null; //To change body of implemented methods use File | Settings | File Templates.
138:                }
139:
140:                public String getInitParameter(String s) {
141:                    return null; //To change body of implemented methods use File | Settings | File Templates.
142:                }
143:
144:                public Enumeration getInitParameterNames() {
145:                    return null; //To change body of implemented methods use File | Settings | File Templates.
146:                }
147:
148:                public Object getAttribute(String s) {
149:                    return null; //To change body of implemented methods use File | Settings | File Templates.
150:                }
151:
152:                public Enumeration getAttributeNames() {
153:                    return null; //To change body of implemented methods use File | Settings | File Templates.
154:                }
155:            }
156:
157:            private Map requestParameterMap = new HashMap();
158:            private Map requestMap = new HashMap();
159:            private Map applicationMap = new HashMap();
160:            private Map sessionMap = new HashMap();
161:
162:            @Override
163:            public void dispatch(String path) throws IOException {
164:                throw new RuntimeException("not implemented");
165:            }
166:
167:            @Override
168:            public String encodeActionURL(String url) {
169:                throw new RuntimeException("not implemented");
170:            }
171:
172:            @Override
173:            public String encodeNamespace(String name) {
174:                throw new RuntimeException("not implemented");
175:            }
176:
177:            @Override
178:            public String encodeResourceURL(String url) {
179:                throw new RuntimeException("not implemented");
180:            }
181:
182:            @Override
183:            public Map getApplicationMap() {
184:                return applicationMap;
185:            }
186:
187:            @Override
188:            public String getAuthType() {
189:                throw new RuntimeException("not implemented");
190:            }
191:
192:            @Override
193:            public Object getContext() {
194:                return new MockServletContext();
195:            }
196:
197:            @Override
198:            public String getInitParameter(String name) {
199:                throw new RuntimeException("not implemented");
200:            }
201:
202:            @Override
203:            public Map getInitParameterMap() {
204:                throw new RuntimeException("not implemented");
205:            }
206:
207:            @Override
208:            public String getRemoteUser() {
209:                throw new RuntimeException("not implemented");
210:            }
211:
212:            @Override
213:            public Object getRequest() {
214:                throw new RuntimeException("not implemented");
215:            }
216:
217:            @Override
218:            public String getRequestContextPath() {
219:                throw new RuntimeException("not implemented");
220:            }
221:
222:            @Override
223:            public Map getRequestCookieMap() {
224:                throw new RuntimeException("not implemented");
225:            }
226:
227:            @Override
228:            public Map getRequestHeaderMap() {
229:                throw new RuntimeException("not implemented");
230:            }
231:
232:            @Override
233:            public Map getRequestHeaderValuesMap() {
234:                throw new RuntimeException("not implemented");
235:            }
236:
237:            @Override
238:            public Locale getRequestLocale() {
239:                throw new RuntimeException("not implemented");
240:            }
241:
242:            @Override
243:            public Iterator getRequestLocales() {
244:                throw new RuntimeException("not implemented");
245:            }
246:
247:            @Override
248:            public Map getRequestMap() {
249:                return requestMap;
250:            }
251:
252:            @Override
253:            public Map getRequestParameterMap() {
254:                return requestParameterMap;
255:            }
256:
257:            @Override
258:            public Iterator getRequestParameterNames() {
259:                return requestParameterMap.keySet().iterator();
260:            }
261:
262:            @Override
263:            public Map getRequestParameterValuesMap() {
264:                throw new RuntimeException("not implemented");
265:            }
266:
267:            @Override
268:            public String getRequestPathInfo() {
269:                throw new RuntimeException("not implemented");
270:            }
271:
272:            @Override
273:            public String getRequestServletPath() {
274:                throw new RuntimeException("not implemented");
275:            }
276:
277:            @Override
278:            public URL getResource(String path) throws MalformedURLException {
279:                throw new RuntimeException("not implemented");
280:            }
281:
282:            @Override
283:            public InputStream getResourceAsStream(String path) {
284:                throw new RuntimeException("not implemented");
285:            }
286:
287:            @Override
288:            public Set getResourcePaths(String path) {
289:                throw new RuntimeException("not implemented");
290:            }
291:
292:            @Override
293:            public Object getResponse() {
294:                throw new RuntimeException("not implemented");
295:            }
296:
297:            @Override
298:            public Object getSession(boolean create) {
299:                throw new RuntimeException("not implemented");
300:            }
301:
302:            @Override
303:            public Map getSessionMap() {
304:                return sessionMap;
305:            }
306:
307:            @Override
308:            public Principal getUserPrincipal() {
309:                throw new RuntimeException("not implemented");
310:            }
311:
312:            @Override
313:            public boolean isUserInRole(String role) {
314:                throw new RuntimeException("not implemented");
315:            }
316:
317:            @Override
318:            public void log(String message, Throwable exception) {
319:                throw new RuntimeException("not implemented");
320:            }
321:
322:            @Override
323:            public void log(String message) {
324:                throw new RuntimeException("not implemented");
325:            }
326:
327:            @Override
328:            public void redirect(String url) throws IOException {
329:                throw new RuntimeException("not implemented");
330:            }
331:
332:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.