Java Doc for WebMockObjectFactory.java in  » Testing » mockrunner-0.4 » com » mockrunner » mock » web » 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 » Testing » mockrunner 0.4 » com.mockrunner.mock.web 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mockrunner.mock.web.WebMockObjectFactory

All known Subclasses:   com.mockrunner.mock.web.ActionMockObjectFactory,
WebMockObjectFactory
public class WebMockObjectFactory (Code)
Used to create all types of web mock objects. Maintains the necessary dependencies between the mock objects. If you use the mock objects returned by this factory in your tests you can be sure that they are all up to date.



Constructor Summary
public  WebMockObjectFactory()
     Creates a new set of mock objects.
public  WebMockObjectFactory(WebMockObjectFactory factory)
     Creates a set of mock objects based on another one.
public  WebMockObjectFactory(WebMockObjectFactory factory, boolean createNewSession)
     Creates a set of mock objects based on another one. You can specify, if the created mock objects should share the same session.

Method Summary
public  voidaddRequestWrapper(Class wrapper)
     Can be used to add a request wrapper.
public  voidaddRequestWrapper(HttpServletRequest wrapper)
     Can be used to add a request wrapper.
public  voidaddResponseWrapper(Class wrapper)
     Can be used to add a response wrapper.
public  voidaddResponseWrapper(HttpServletResponse wrapper)
     Can be used to add a response wrapper.
public  MockFilterChaincreateMockFilterChain()
     Creates the com.mockrunner.mock.web.MockFilterChain using new.
public  MockFilterConfigcreateMockFilterConfig()
     Creates the com.mockrunner.mock.web.MockFilterConfig using new.
public  MockJspFactorycreateMockJspFactory()
     Creates the com.mockrunner.mock.web.MockJspFactory using new.
public  MockPageContextcreateMockPageContext()
     Creates the com.mockrunner.mock.web.MockPageContext using new.
public  MockHttpServletRequestcreateMockRequest()
     Creates the com.mockrunner.mock.web.MockHttpServletRequest using new.
public  MockHttpServletResponsecreateMockResponse()
     Creates the com.mockrunner.mock.web.MockHttpServletResponse using new.
public  MockServletConfigcreateMockServletConfig()
     Creates the com.mockrunner.mock.web.MockServletConfig using new.
public  MockServletContextcreateMockServletContext()
     Creates the com.mockrunner.mock.web.MockServletContext using new.
public  MockHttpSessioncreateMockSession()
     Creates the com.mockrunner.mock.web.MockHttpSession using new.
public  JspFactorygetJspFactory()
     Returns the JspFactory.
public  MockFilterChaingetMockFilterChain()
     Returns the com.mockrunner.mock.web.MockFilterChain .
public  MockFilterConfiggetMockFilterConfig()
     Returns the com.mockrunner.mock.web.MockFilterConfig .
public  MockJspFactorygetMockJspFactory()
     Returns the com.mockrunner.mock.web.MockJspFactory .
public  MockPageContextgetMockPageContext()
     Returns the com.mockrunner.mock.web.MockPageContext .
public  MockHttpServletRequestgetMockRequest()
     Returns the com.mockrunner.mock.web.MockHttpServletRequest .
public  MockHttpServletResponsegetMockResponse()
     Returns the com.mockrunner.mock.web.MockHttpServletResponse .
public  MockServletConfiggetMockServletConfig()
    
public  MockServletContextgetMockServletContext()
     Returns the com.mockrunner.mock.web.MockServletContext .
public  MockHttpSessiongetMockSession()
     Returns the com.mockrunner.mock.web.MockHttpSession .
public  MockHttpSessiongetSession()
     Returns the com.mockrunner.mock.web.MockHttpSession .
public  HttpServletRequestgetWrappedRequest()
     Returns the wrapped HttpServletRequest.
public  HttpServletResponsegetWrappedResponse()
     Returns the wrapped HttpServletResponse.
public  voidrefresh()
     Refreshes the mock objects dependencies.
public  voidsetDefaultJspFactory(JspFactory jspFactory)
     Sets the default JspFactory by calling JspFactory.setDefaultFactory().


Constructor Detail
WebMockObjectFactory
public WebMockObjectFactory()(Code)
Creates a new set of mock objects.



WebMockObjectFactory
public WebMockObjectFactory(WebMockObjectFactory factory)(Code)
Creates a set of mock objects based on another one. The created mock objects will have their own request and session objects, but they will share one ServletContext.
Parameters:
  factory - the other factory
See Also:   com.mockrunner.base.BaseTestCase.createWebMockObjectFactory(WebMockObjectFactory)



WebMockObjectFactory
public WebMockObjectFactory(WebMockObjectFactory factory, boolean createNewSession)(Code)
Creates a set of mock objects based on another one. You can specify, if the created mock objects should share the same session. They will share one ServletContext anyway.
Parameters:
  factory - the other factory
Parameters:
  createNewSession - true creates a new session,false uses the session from factory
See Also:   com.mockrunner.base.BaseTestCase.createWebMockObjectFactory(WebMockObjectFactoryboolean)




Method Detail
addRequestWrapper
public void addRequestWrapper(Class wrapper)(Code)
Can be used to add a request wrapper. All the test modules are using the wrapped request returned by WebMockObjectFactory.getWrappedRequest . The method WebMockObjectFactory.getMockRequest returns the mock request without any wrapper. Usually the wrapper is of type javax.servlet.http.HttpServletRequestWrapper. That's not absolutely necessary but the wrapper must define a constructor that takes a single javax.servlet.http.HttpServletRequest argument and must implement javax.servlet.http.HttpServletRequest.
Parameters:
  wrapper - the wrapper class



addRequestWrapper
public void addRequestWrapper(HttpServletRequest wrapper)(Code)
Can be used to add a request wrapper. All the test modules are using the wrapped request returned by WebMockObjectFactory.getWrappedRequest . The method WebMockObjectFactory.getMockRequest returns the mock request without any wrapper. Usually the wrapper is an instance of javax.servlet.http.HttpServletRequestWrapper and wraps the current request but that's not absolutely necessary. However, be careful if you want to add custom mock versions of javax.servlet.http.HttpServletRequest.
Parameters:
  wrapper - the request wrapper



addResponseWrapper
public void addResponseWrapper(Class wrapper)(Code)
Can be used to add a response wrapper. All the test modules are using the wrapped response returned by WebMockObjectFactory.getWrappedResponse . The method WebMockObjectFactory.getMockResponse returns the mock response without any wrapper. Usually the wrapper is of type javax.servlet.http.HttpServletResponseWrapper. That's not absolutely necessary but the wrapper must define a constructor that takes a single javax.servlet.http.HttpServletResponse argument and must implement javax.servlet.http.HttpServletResponse.
Parameters:
  wrapper - the wrapper class



addResponseWrapper
public void addResponseWrapper(HttpServletResponse wrapper)(Code)
Can be used to add a response wrapper. All the test modules are using the wrapped response returned by WebMockObjectFactory.getWrappedResponse . The method WebMockObjectFactory.getMockResponse returns the mock response without any wrapper. Usually the wrapper is an instance of javax.servlet.http.HttpServletResponseWrapper and wraps the current response but that's not absolutely necessary. However, be careful if you want to add custom mock versions of javax.servlet.http.HttpServletResponse.
Parameters:
  wrapper - the wrapper



createMockFilterChain
public MockFilterChain createMockFilterChain()(Code)
Creates the com.mockrunner.mock.web.MockFilterChain using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockFilterChain . the com.mockrunner.mock.web.MockFilterChain



createMockFilterConfig
public MockFilterConfig createMockFilterConfig()(Code)
Creates the com.mockrunner.mock.web.MockFilterConfig using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockFilterConfig . the com.mockrunner.mock.web.MockFilterConfig



createMockJspFactory
public MockJspFactory createMockJspFactory()(Code)
Creates the com.mockrunner.mock.web.MockJspFactory using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockJspFactory . the com.mockrunner.mock.web.MockJspFactory



createMockPageContext
public MockPageContext createMockPageContext()(Code)
Creates the com.mockrunner.mock.web.MockPageContext using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockPageContext . the com.mockrunner.mock.web.MockPageContext



createMockRequest
public MockHttpServletRequest createMockRequest()(Code)
Creates the com.mockrunner.mock.web.MockHttpServletRequest using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockHttpServletRequest . the com.mockrunner.mock.web.MockHttpServletRequest



createMockResponse
public MockHttpServletResponse createMockResponse()(Code)
Creates the com.mockrunner.mock.web.MockHttpServletResponse using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockHttpServletResponse . the com.mockrunner.mock.web.MockHttpServletResponse



createMockServletConfig
public MockServletConfig createMockServletConfig()(Code)
Creates the com.mockrunner.mock.web.MockServletConfig using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockServletConfig . the com.mockrunner.mock.web.MockServletConfig



createMockServletContext
public MockServletContext createMockServletContext()(Code)
Creates the com.mockrunner.mock.web.MockServletContext using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockServletContext . the com.mockrunner.mock.web.MockServletContext



createMockSession
public MockHttpSession createMockSession()(Code)
Creates the com.mockrunner.mock.web.MockHttpSession using new. This method can be overridden to return a subclass of com.mockrunner.mock.web.MockHttpSession . the com.mockrunner.mock.web.MockHttpSession



getJspFactory
public JspFactory getJspFactory()(Code)
Returns the JspFactory. the JspFactory



getMockFilterChain
public MockFilterChain getMockFilterChain()(Code)
Returns the com.mockrunner.mock.web.MockFilterChain . the com.mockrunner.mock.web.MockFilterChain



getMockFilterConfig
public MockFilterConfig getMockFilterConfig()(Code)
Returns the com.mockrunner.mock.web.MockFilterConfig . the com.mockrunner.mock.web.MockFilterConfig



getMockJspFactory
public MockJspFactory getMockJspFactory()(Code)
Returns the com.mockrunner.mock.web.MockJspFactory . If the current JspFactory is not an instance of com.mockrunner.mock.web.MockJspFactory , null will be returned. the com.mockrunner.mock.web.MockJspFactory



getMockPageContext
public MockPageContext getMockPageContext()(Code)
Returns the com.mockrunner.mock.web.MockPageContext . the com.mockrunner.mock.web.MockPageContext



getMockRequest
public MockHttpServletRequest getMockRequest()(Code)
Returns the com.mockrunner.mock.web.MockHttpServletRequest . the com.mockrunner.mock.web.MockHttpServletRequest



getMockResponse
public MockHttpServletResponse getMockResponse()(Code)
Returns the com.mockrunner.mock.web.MockHttpServletResponse . the com.mockrunner.mock.web.MockHttpServletResponse



getMockServletConfig
public MockServletConfig getMockServletConfig()(Code)
Returns the MockServletConfig the MockServletConfig



getMockServletContext
public MockServletContext getMockServletContext()(Code)
Returns the com.mockrunner.mock.web.MockServletContext . the com.mockrunner.mock.web.MockServletContext



getMockSession
public MockHttpSession getMockSession()(Code)
Returns the com.mockrunner.mock.web.MockHttpSession . the com.mockrunner.mock.web.MockHttpSession



getSession
public MockHttpSession getSession()(Code)
Returns the com.mockrunner.mock.web.MockHttpSession . the com.mockrunner.mock.web.MockHttpSessionWebMockObjectFactory.getMockSession



getWrappedRequest
public HttpServletRequest getWrappedRequest()(Code)
Returns the wrapped HttpServletRequest. If no wrapper is specified, this method returns the mock request itself. the wrapped HttpServletRequest



getWrappedResponse
public HttpServletResponse getWrappedResponse()(Code)
Returns the wrapped HttpServletResponse. If no wrapper is specified, this method returns the mock response itself. the wrapped HttpServletRequest



refresh
public void refresh()(Code)
Refreshes the mock objects dependencies. May be called after setting request and response wrappers.



setDefaultJspFactory
public void setDefaultJspFactory(JspFactory jspFactory)(Code)
Sets the default JspFactory by calling JspFactory.setDefaultFactory().
Parameters:
  jspFactory - the JspFactory



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.