Java Doc for MockRequest.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » test » 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 » Web Framework » rife 1.6.1 » com.uwyn.rife.test 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.uwyn.rife.test.MockRequest

MockRequest
public class MockRequest implements Request(Code)
Provides a Request implementation that is suitable for testing a web application outside of a servlet container.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3669 $
since:
   1.1




Method Summary
public  MockRequestaddDateHeader(String name, long value)
     Adds a request header with the given name and date-value.
public  MockRequestaddHeader(String name, String value)
     Adds a request header with the given name and value.
public  MockRequestaddIntHeader(String name, int value)
     Adds a request header with the given name and integer value.
public  voidaddLocale(Locale locale)
     Adds a Locale to this request.
public  MockRequestcharacterEncoding(String encoding)
     Set the character encoding of this request.
public  booleancontainsHeader(String name)
     Checks whether a certain request header is present.
public  MockRequestcontentType(String type)
     Set the content type of this request.
public  MockRequestdateHeader(String name, long value)
     Sets a request header with the given name and date-value.
public  MockRequestfile(String name, MockFileUpload file)
     Sets a file in this request.
public  MockRequestfiles(Map<String, MockFileUpload[]> files)
     Sets a map of files in this request.
public  MockRequestfiles(String name, MockFileUpload[] files)
     Sets files in this request.
public  ObjectgetAttribute(String name)
    
public  EnumerationgetAttributeNames()
    
public  StringgetCharacterEncoding()
    
public  StringgetContentType()
    
public  StringgetContextPath()
    
public  CookiegetCookie(String name)
    
public  Cookie[]getCookies()
    
public  longgetDateHeader(String name)
    
public  UploadedFilegetFile(String name)
    
public  Map<String, UploadedFile[]>getFiles()
    
public  UploadedFile[]getFiles(String name)
    
public  StringgetHeader(String name)
    
public  EnumerationgetHeaderNames()
    
public  EnumerationgetHeaders(String name)
    
public  HttpServletRequestgetHttpServletRequest()
    
public  intgetIntHeader(String name)
    
public  LocalegetLocale()
    
public  EnumerationgetLocales()
    
public  RequestMethodgetMethod()
    
public  Map<String, String[]>getParameters()
     Retrieves all the parameters of this request.
public  StringgetProtocol()
    
public  StringgetRemoteAddr()
    
public  StringgetRemoteHost()
    
public  StringgetRemoteUser()
    
public  RequestDispatchergetRequestDispatcher(String url)
    
 StringgetRequestedSessionId()
    
public  StringgetScheme()
    
public  StringgetServerName()
    
public  intgetServerPort()
    
public  StringgetServerRootUrl(int port)
    
public  HttpSessiongetSession(boolean create)
    
public  HttpSessiongetSession()
    
public  booleanhasAttribute(String name)
    
public  booleanhasCookie(String name)
    
public  booleanhasFile(String name)
    
public  booleanhasParameter(String name)
     Checks whether a named parameter is present in this request.
public  MockRequestheader(String name, String value)
     Sets a request header with the given name and value.
public  voidinit(StateStore stateStore)
    
public  MockRequestintHeader(String name, int value)
     Sets a request header with the given name and integer value.
 booleanisRequestedSessionIdFromCookie()
    
public  booleanisSecure()
    
public  MockRequestlocale(Locale locale)
     Adds a Locale to this request.
public  MockRequestmethod(RequestMethod method)
     Sets the method of this request.
 MockSessionnewSession()
    
public  MockRequestparameter(String name, String[] values)
     Sets a parameter in this request.
public  MockRequestparameter(String name, String value)
     Sets a parameter in this request.
public  MockRequestparameters(Map<String, String[]> parameters)
     Sets a map of parameters in this request.
public  MockRequestprotocol(String protocol)
     Set the protocol of this request.
public  MockRequestremoteAddr(String remoteAddr)
     Set the remote address of this request.
public  MockRequestremoteHost(String remoteHost)
     Set the remote host of this request.
public  MockRequestremoteUser(String remoteUser)
     Set the remote user of this request.
public  voidremoveAttribute(String name)
    
public  voidremoveHeader(String name)
     Removes a request header with the given name.
public  MockRequestsecure(boolean secure)
     Set whether this request is secure.
public  voidsetAttribute(String name, Object object)
    
public  voidsetCharacterEncoding(String encoding)
     Set the character encoding of this request.
public  voidsetContentType(String type)
     Set the content type of this request.
public  voidsetDateHeader(String name, long value)
     Sets a request header with the given name and date-value.
public  voidsetFile(String name, MockFileUpload file)
     Sets a file in this request.
public  voidsetFiles(Map<String, MockFileUpload[]> files)
     Sets a map of files in this request.
public  voidsetFiles(String name, MockFileUpload[] files)
     Sets files in this request.
public  voidsetHeader(String name, String value)
     Sets a request header with the given name and value.
public  voidsetIntHeader(String name, int value)
     Sets a request header with the given name and integer value.
public  voidsetMethod(RequestMethod method)
     Sets the method of this request.
 voidsetMockConversation(MockConversation conversation)
    
 voidsetMockResponse(MockResponse response)
    
public  voidsetParameter(String name, String[] values)
     Sets a parameter in this request.
public  voidsetParameter(String name, String value)
     Sets a parameter in this request.
public  voidsetParameters(Map<String, String[]> parameters)
     Sets a map of parameters in this request.
public  voidsetProtocol(String protocol)
     Set the protocol of this request.
public  voidsetRemoteAddr(String remoteAddr)
     Set the remote address of this request.
public  voidsetRemoteHost(String remoteHost)
     Set the remote host of this request.
public  voidsetRemoteUser(String remoteUser)
     Set the remote user of this request.
 voidsetRequestedSessionId(String pathParams)
    
public  voidsetSecure(boolean secure)
     Set whether this request is secure.



Method Detail
addDateHeader
public MockRequest addDateHeader(String name, long value)(Code)
Adds a request header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. This method allows request headers to have multiple values.
Parameters:
  name - the name of the header to set
Parameters:
  value - the additional date value this MockRequest instance
since:
   1.1



addHeader
public MockRequest addHeader(String name, String value)(Code)
Adds a request header with the given name and value. This method allows request headers to have multiple values.
Parameters:
  name - the name of the header to set
Parameters:
  value - the additional header value this MockRequest instance
since:
   1.1



addIntHeader
public MockRequest addIntHeader(String name, int value)(Code)
Adds a request header with the given name and integer value. This method allows request headers to have multiple values.
Parameters:
  name - the name of the header to set
Parameters:
  value - the additional integer value this MockRequest instance
since:
   1.1



addLocale
public void addLocale(Locale locale)(Code)
Adds a Locale to this request.
Parameters:
  locale - the locale to add
since:
   1.1



characterEncoding
public MockRequest characterEncoding(String encoding)(Code)
Set the character encoding of this request.
Parameters:
  encoding - the name of the character encoding this MockRequest instance
since:
   1.1



containsHeader
public boolean containsHeader(String name)(Code)
Checks whether a certain request header is present.
Parameters:
  name - the name of the header to check true if the header was present; or

false otherwise
since:
   1.1




contentType
public MockRequest contentType(String type)(Code)
Set the content type of this request.
Parameters:
  type - the content type this MockRequest instance
since:
   1.1



dateHeader
public MockRequest dateHeader(String name, long value)(Code)
Sets a request header with the given name and date-value.
Parameters:
  name - the name of the header to set
Parameters:
  value - the assigned date value
See Also:   MockRequest.setDateHeader
since:
   1.1



file
public MockRequest file(String name, MockFileUpload file)(Code)
Sets a file in this request.
Parameters:
  name - the parameter name of the file
Parameters:
  file - the file specification that will be uploaded this MockRequest instance
See Also:   MockRequest.hasFile
See Also:   MockRequest.getFile
See Also:   MockRequest.getFiles
See Also:   MockRequest.setFile(String,MockFileUpload)
See Also:   MockRequest.setFiles(Map)
See Also:   MockRequest.setFiles(String,MockFileUpload[])
since:
   1.1



files
public MockRequest files(Map<String, MockFileUpload[]> files)(Code)
Sets a map of files in this request.
Parameters:
  files - a Map of the files that will be set with thenames as the keys and their file upload specifications as the values this MockRequest instance
See Also:   MockRequest.hasFile
See Also:   MockRequest.getFile
See Also:   MockRequest.getFiles
See Also:   MockRequest.setFile(String,MockFileUpload)
See Also:   MockRequest.setFiles(Map)
See Also:   MockRequest.setFiles(String,MockFileUpload[])
since:
   1.1



files
public MockRequest files(String name, MockFileUpload[] files)(Code)
Sets files in this request.
Parameters:
  name - the parameter name of the file
Parameters:
  files - the file specifications that will be uploaded this MockRequest instance
See Also:   MockRequest.hasFile
See Also:   MockRequest.getFile
See Also:   MockRequest.getFiles
See Also:   MockRequest.setFile(String,MockFileUpload)
See Also:   MockRequest.setFiles(Map)
See Also:   MockRequest.setFiles(String,MockFileUpload[])
since:
   1.1



getAttribute
public Object getAttribute(String name)(Code)



getAttributeNames
public Enumeration getAttributeNames()(Code)



getCharacterEncoding
public String getCharacterEncoding()(Code)



getContentType
public String getContentType()(Code)



getContextPath
public String getContextPath()(Code)



getCookie
public Cookie getCookie(String name)(Code)



getCookies
public Cookie[] getCookies()(Code)



getDateHeader
public long getDateHeader(String name)(Code)



getFile
public UploadedFile getFile(String name)(Code)



getFiles
public Map<String, UploadedFile[]> getFiles()(Code)



getFiles
public UploadedFile[] getFiles(String name)(Code)



getHeader
public String getHeader(String name)(Code)



getHeaderNames
public Enumeration getHeaderNames()(Code)



getHeaders
public Enumeration getHeaders(String name)(Code)



getHttpServletRequest
public HttpServletRequest getHttpServletRequest()(Code)



getIntHeader
public int getIntHeader(String name)(Code)



getLocale
public Locale getLocale()(Code)



getLocales
public Enumeration getLocales()(Code)



getMethod
public RequestMethod getMethod()(Code)



getParameters
public Map<String, String[]> getParameters()(Code)
Retrieves all the parameters of this request. a Map of the parameters with the names as the keysand their value arrays as the values
See Also:   MockRequest.hasParameter
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String[])
See Also:   MockRequest.setParameter(String,String)
since:
   1.1



getProtocol
public String getProtocol()(Code)



getRemoteAddr
public String getRemoteAddr()(Code)



getRemoteHost
public String getRemoteHost()(Code)



getRemoteUser
public String getRemoteUser()(Code)



getRequestDispatcher
public RequestDispatcher getRequestDispatcher(String url)(Code)



getRequestedSessionId
String getRequestedSessionId()(Code)



getScheme
public String getScheme()(Code)



getServerName
public String getServerName()(Code)



getServerPort
public int getServerPort()(Code)



getServerRootUrl
public String getServerRootUrl(int port)(Code)



getSession
public HttpSession getSession(boolean create)(Code)



getSession
public HttpSession getSession()(Code)



hasAttribute
public boolean hasAttribute(String name)(Code)



hasCookie
public boolean hasCookie(String name)(Code)



hasFile
public boolean hasFile(String name)(Code)



hasParameter
public boolean hasParameter(String name)(Code)
Checks whether a named parameter is present in this request.
Parameters:
  name - the name of the parameter to check true if the parameter is present; or

false otherwise
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String[])
See Also:   MockRequest.setParameter(String,String)
since:
   1.1




header
public MockRequest header(String name, String value)(Code)
Sets a request header with the given name and value.
Parameters:
  name - the name of the header to set
Parameters:
  value - the header value
See Also:   MockRequest.setDateHeader
since:
   1.1



init
public void init(StateStore stateStore)(Code)



intHeader
public MockRequest intHeader(String name, int value)(Code)
Sets a request header with the given name and integer value.
Parameters:
  name - the name of the header to set
Parameters:
  value - the assigned integer value
See Also:   MockRequest.setDateHeader
since:
   1.1



isRequestedSessionIdFromCookie
boolean isRequestedSessionIdFromCookie()(Code)



isSecure
public boolean isSecure()(Code)



locale
public MockRequest locale(Locale locale)(Code)
Adds a Locale to this request.
Parameters:
  locale - the locale to add this MockRequest instance
since:
   1.1



method
public MockRequest method(RequestMethod method)(Code)
Sets the method of this request.
Parameters:
  method - the method that will be used by this request this MockRequest instance
See Also:   MockRequest.getMethod
See Also:   MockRequest.setMethod
since:
   1.1



newSession
MockSession newSession()(Code)



parameter
public MockRequest parameter(String name, String[] values)(Code)
Sets a parameter in this request.
Parameters:
  name - the name of the parameter
Parameters:
  values - the value array of the parameter this MockRequest instance
See Also:   MockRequest.hasParameter
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String[])
See Also:   MockRequest.setParameter(String,String)
since:
   1.1



parameter
public MockRequest parameter(String name, String value)(Code)
Sets a parameter in this request.
Parameters:
  name - the name of the parameter
Parameters:
  value - the value of the parameter this MockRequest instance
See Also:   MockRequest.hasParameter
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String[])
See Also:   MockRequest.setParameter(String,String)
since:
   1.1



parameters
public MockRequest parameters(Map<String, String[]> parameters)(Code)
Sets a map of parameters in this request.
Parameters:
  parameters - a Map of the parameters that will be setwith the names as the keys and their value arrays as the values this MockRequest instance
See Also:   MockRequest.hasParameter
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String[])
See Also:   MockRequest.setParameter(String,String)
since:
   1.1



protocol
public MockRequest protocol(String protocol)(Code)
Set the protocol of this request.
Parameters:
  protocol - the protocol to set this MockRequest instance
since:
   1.1



remoteAddr
public MockRequest remoteAddr(String remoteAddr)(Code)
Set the remote address of this request.
Parameters:
  remoteAddr - the remote address to set this MockRequest instance
since:
   1.1



remoteHost
public MockRequest remoteHost(String remoteHost)(Code)
Set the remote host of this request.
Parameters:
  remoteHost - the remote host to set this MockRequest instance
since:
   1.1



remoteUser
public MockRequest remoteUser(String remoteUser)(Code)
Set the remote user of this request.
Parameters:
  remoteUser - the remote user to set this MockRequest instance
since:
   1.1



removeAttribute
public void removeAttribute(String name)(Code)



removeHeader
public void removeHeader(String name)(Code)
Removes a request header with the given name.
Parameters:
  name - the name of the header to remove
since:
   1.1



secure
public MockRequest secure(boolean secure)(Code)
Set whether this request is secure.
Parameters:
  secure - true if this request is secure; or

false otherwise this MockRequest instance
since:
   1.1




setAttribute
public void setAttribute(String name, Object object)(Code)



setCharacterEncoding
public void setCharacterEncoding(String encoding)(Code)
Set the character encoding of this request.
Parameters:
  encoding - the name of the character encoding
since:
   1.1



setContentType
public void setContentType(String type)(Code)
Set the content type of this request.
Parameters:
  type - the content type
since:
   1.1



setDateHeader
public void setDateHeader(String name, long value)(Code)
Sets a request header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. If the header had already been set, the new value overwrites the previous one. The MockRequest.containsHeader method can be used to test for the presence of a header before setting its value.
Parameters:
  name - the name of the header to set
Parameters:
  value - the assigned date value
since:
   1.1



setFile
public void setFile(String name, MockFileUpload file)(Code)
Sets a file in this request.
Parameters:
  name - the parameter name of the file
Parameters:
  file - the file specification that will be uploaded
See Also:   MockRequest.hasFile
See Also:   MockRequest.getFile
See Also:   MockRequest.getFiles
See Also:   MockRequest.setFiles(Map)
See Also:   MockRequest.setFiles(String,MockFileUpload[])
since:
   1.1



setFiles
public void setFiles(Map<String, MockFileUpload[]> files)(Code)
Sets a map of files in this request.
Parameters:
  files - a Map of the files that will be set with thenames as the keys and their file upload specifications as the values
See Also:   MockRequest.hasFile
See Also:   MockRequest.getFile
See Also:   MockRequest.getFiles
See Also:   MockRequest.setFile(String,MockFileUpload)
See Also:   MockRequest.setFiles(String,MockFileUpload[])
since:
   1.1



setFiles
public void setFiles(String name, MockFileUpload[] files)(Code)
Sets files in this request.
Parameters:
  name - the parameter name of the file
Parameters:
  files - the file specifications that will be uploaded
See Also:   MockRequest.hasFile
See Also:   MockRequest.getFile
See Also:   MockRequest.getFiles
See Also:   MockRequest.setFile(String,MockFileUpload)
See Also:   MockRequest.setFiles(Map)
since:
   1.1



setHeader
public void setHeader(String name, String value)(Code)
Sets a request header with the given name and value. If the header had already been set, the new value overwrites the previous one. The MockRequest.containsHeader method can be used to test for the presence of a header before setting its value.
Parameters:
  name - the name of the header to set
Parameters:
  value - the header value
since:
   1.1



setIntHeader
public void setIntHeader(String name, int value)(Code)
Sets a request header with the given name and integer value. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
Parameters:
  name - the name of the header to set
Parameters:
  value - the assigned integer value
since:
   1.1



setMethod
public void setMethod(RequestMethod method)(Code)
Sets the method of this request.

The method defaults to RequestMethod.GET .
Parameters:
  method - the method that will be used by this request
See Also:   MockRequest.getMethod
See Also:   MockRequest.method
since:
   1.1




setMockConversation
void setMockConversation(MockConversation conversation)(Code)



setMockResponse
void setMockResponse(MockResponse response)(Code)



setParameter
public void setParameter(String name, String[] values)(Code)
Sets a parameter in this request.
Parameters:
  name - the name of the parameter
Parameters:
  values - the value array of the parameter
See Also:   MockRequest.hasParameter
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String)
since:
   1.1



setParameter
public void setParameter(String name, String value)(Code)
Sets a parameter in this request.
Parameters:
  name - the name of the parameter
Parameters:
  value - the value of the parameter
See Also:   MockRequest.hasParameter
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameters
See Also:   MockRequest.setParameter(String,String[])
since:
   1.1



setParameters
public void setParameters(Map<String, String[]> parameters)(Code)
Sets a map of parameters in this request.
Parameters:
  parameters - a Map of the parameters that will be setwith the names as the keys and their value arrays as the values
See Also:   MockRequest.hasParameter
See Also:   MockRequest.getParameters
See Also:   MockRequest.setParameter(String,String[])
See Also:   MockRequest.setParameter(String,String)
since:
   1.1



setProtocol
public void setProtocol(String protocol)(Code)
Set the protocol of this request.

The default protocol is "HTTP/1.1".
Parameters:
  protocol - the protocol to set
since:
   1.1




setRemoteAddr
public void setRemoteAddr(String remoteAddr)(Code)
Set the remote address of this request.

The default remote address is "127.0.0.1".
Parameters:
  remoteAddr - the remote address to set
since:
   1.1




setRemoteHost
public void setRemoteHost(String remoteHost)(Code)
Set the remote host of this request.

The default remote host is "localhost".
Parameters:
  remoteHost - the remote host to set
since:
   1.1




setRemoteUser
public void setRemoteUser(String remoteUser)(Code)
Set the remote user of this request.

The default remote user is null.
Parameters:
  remoteUser - the remote user to set
since:
   1.1




setRequestedSessionId
void setRequestedSessionId(String pathParams)(Code)



setSecure
public void setSecure(boolean secure)(Code)
Set whether this request is secure.

A request is not secure by default.
Parameters:
  secure - true if this request is secure; or

false otherwise
since:
   1.1




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.