Java Doc for WebRequest.java in  » Testing » jakarta-cactus » org » apache » cactus » 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 » jakarta cactus » org.apache.cactus 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cactus.WebRequest

All known Subclasses:   org.apache.cactus.internal.BaseWebRequest,
WebRequest
public interface WebRequest extends Request(Code)
Contains HTTP request data for a Cactus test case.
version:
   $Id: WebRequest.java 238991 2004-05-22 11:34:50Z vmassol $


Field Summary
 StringGET_METHOD
     GET Method identifier.
 StringPOST_METHOD
     POST Method identifier.


Method Summary
 voidaddCookie(String theName, String theValue)
     Adds a cookie to the request.
 voidaddCookie(String theDomain, String theName, String theValue)
     Adds a cookie to the request.
 voidaddCookie(Cookie theCookie)
     Adds a cookie to the request.
 voidaddHeader(String theName, String theValue)
     Adds a header to the request.
 voidaddParameter(String theName, String theValue, String theMethod)
     Adds a parameter to the request.
 voidaddParameter(String theName, String theValue)
     Adds a parameter to the request.
 AuthenticationgetAuthentication()
    
 booleangetAutomaticSession()
    
 StringgetContentType()
    
 VectorgetCookies()
    
 StringgetHeader(String theName)
     Returns the first value corresponding to this header's name.
 EnumerationgetHeaderNames()
    
 String[]getHeaderValues(String theName)
     Returns all the values associated with this header's name.
 StringgetParameterGet(String theName)
     Returns the first value corresponding to this parameter's name (provided this parameter is passed in the URL).
 EnumerationgetParameterNamesGet()
    
 EnumerationgetParameterNamesPost()
    
 StringgetParameterPost(String theName)
     Returns the first value corresponding to this parameter's name (provided this parameter is passed in the request body - POST).
 String[]getParameterValuesGet(String theName)
     Returns all the values corresponding to this parameter's name (provided this parameter is passed in the URL).
 String[]getParameterValuesPost(String theName)
     Returns all the values corresponding to this parameter's name (provided this parameter is passed in the request body - POST).
 StringgetRedirectorName()
    
 HttpSessionCookiegetSessionCookie()
     Gets an HTTP session id by calling the server side and retrieving the jsessionid cookie in the HTTP response.
 ServletURLgetURL()
    
 InputStreamgetUserData()
    
 voidsetAuthentication(Authentication theAuthentication)
    
 voidsetAutomaticSession(boolean isAutomaticSession)
    
Parameters:
  isAutomaticSession - whether the redirector servlet willautomatically create the HTTP session or not.
 voidsetContentType(String theContentType)
    
 voidsetRedirectorName(String theRedirectorName)
     Override the redirector Name defined in cactus.properties.
 voidsetURL(String theServerName, String theContextPath, String theServletPath, String thePathInfo, String theQueryString)
     Sets the simulated URL.
 voidsetUserData(InputStream theDataStream)
    

Field Detail
GET_METHOD
String GET_METHOD(Code)
GET Method identifier.



POST_METHOD
String POST_METHOD(Code)
POST Method identifier.





Method Detail
addCookie
void addCookie(String theName, String theValue)(Code)
Adds a cookie to the request. The cookie will be created with a default localhost domain. If you need to specify a domain for the cookie, use the WebRequest.addCookie(String,String,String) method or the method WebRequest.addCookie(Cookie) .
Parameters:
  theName - the cookie's name
Parameters:
  theValue - the cookie's value



addCookie
void addCookie(String theDomain, String theName, String theValue)(Code)
Adds a cookie to the request. The cookie will be created with the domain passed as parameter (i.e. the cookie will get sent only to requests to that domain). Note that the domain must match either the redirector host (specified in cactus.properties) or the host set using setURL().
Parameters:
  theDomain - the cookie domain
Parameters:
  theName - the cookie name
Parameters:
  theValue - the cookie value



addCookie
void addCookie(Cookie theCookie)(Code)
Adds a cookie to the request. Note that the domain must match either the redirector host (specified in cactus.properties) or the host set using setURL().
Parameters:
  theCookie - the cookie to add



addHeader
void addHeader(String theName, String theValue)(Code)
Adds a header to the request. Supports adding several values for the same header name.
Parameters:
  theName - the header's name
Parameters:
  theValue - the header's value



addParameter
void addParameter(String theName, String theValue, String theMethod)(Code)
Adds a parameter to the request. It is possible to add several times the the same parameter name, but with different value (the same as for the HttpServletRequest).
Parameters:
  theName - the parameter's name
Parameters:
  theValue - the parameter's value
Parameters:
  theMethod - GET_METHOD or POST_METHOD. If GET_METHOD then theparameter will be sent in the query string of the URL. IfPOST_METHOD, it will be sent as a parameter in the request body.



addParameter
void addParameter(String theName, String theValue)(Code)
Adds a parameter to the request. The parameter is added to the query string of the URL.
Parameters:
  theName - the parameter's name
Parameters:
  theValue - the parameter's value
See Also:   WebRequest.addParameter(String,String,String)



getAuthentication
Authentication getAuthentication()(Code)
the authentication that will configure the http request



getAutomaticSession
boolean getAutomaticSession()(Code)
true if session will be automatically created for the user orfalse otherwise.



getContentType
String getContentType()(Code)
the content type that will be set in the http request



getCookies
Vector getCookies()(Code)
the cookies (vector of Cookie objects)



getHeader
String getHeader(String theName)(Code)
Returns the first value corresponding to this header's name.
Parameters:
  theName - the header's name the first value corresponding to this header's name or null ifnot found



getHeaderNames
Enumeration getHeaderNames()(Code)
the header names



getHeaderValues
String[] getHeaderValues(String theName)(Code)
Returns all the values associated with this header's name.
Parameters:
  theName - the header's name the values corresponding to this header's name or null if notfound



getParameterGet
String getParameterGet(String theName)(Code)
Returns the first value corresponding to this parameter's name (provided this parameter is passed in the URL).
Parameters:
  theName - the parameter's name the first value corresponding to this parameter's name or nullif not found in the list of parameters to be sent in the URL



getParameterNamesGet
Enumeration getParameterNamesGet()(Code)
the parameter names that will be passed in the URL (GET)



getParameterNamesPost
Enumeration getParameterNamesPost()(Code)
the parameter names that will be passed in the request body(POST)



getParameterPost
String getParameterPost(String theName)(Code)
Returns the first value corresponding to this parameter's name (provided this parameter is passed in the request body - POST).
Parameters:
  theName - the parameter's name the first value corresponding to this parameter's name or nullif not found in the list of parameters to be sent in the requestbody



getParameterValuesGet
String[] getParameterValuesGet(String theName)(Code)
Returns all the values corresponding to this parameter's name (provided this parameter is passed in the URL).
Parameters:
  theName - the parameter's name the first value corresponding to this parameter's name or nullif not found in the list of parameters to be sent in the URL



getParameterValuesPost
String[] getParameterValuesPost(String theName)(Code)
Returns all the values corresponding to this parameter's name (provided this parameter is passed in the request body - POST).
Parameters:
  theName - the parameter's name the first value corresponding to this parameter's name or nullif not found in the list of parameters to be sent in the requestbody



getRedirectorName
String getRedirectorName()(Code)
the overriden redirector Name or null if none has been defined



getSessionCookie
HttpSessionCookie getSessionCookie()(Code)
Gets an HTTP session id by calling the server side and retrieving the jsessionid cookie in the HTTP response. This is achieved by calling the Cactus redirector used by the current test case. the HTTP session id as a HttpSessionCookie object



getURL
ServletURL getURL()(Code)
the simulated URL



getUserData
InputStream getUserData()(Code)
the data stream set up by the user



setAuthentication
void setAuthentication(Authentication theAuthentication)(Code)
Sets the authentication object that will configure the http request
Parameters:
  theAuthentication - the authentication object



setAutomaticSession
void setAutomaticSession(boolean isAutomaticSession)(Code)

Parameters:
  isAutomaticSession - whether the redirector servlet willautomatically create the HTTP session or not. Default is true.



setContentType
void setContentType(String theContentType)(Code)
Sets the content type that will be set in the http request
Parameters:
  theContentType - the content type



setRedirectorName
void setRedirectorName(String theRedirectorName)(Code)
Override the redirector Name defined in cactus.properties. This is useful to define a per test case Name (for example, if some test case need to have authentication turned on and not other tests, etc).
Parameters:
  theRedirectorName - the new redirector Name to use



setURL
void setURL(String theServerName, String theContextPath, String theServletPath, String thePathInfo, String theQueryString)(Code)
Sets the simulated URL. A URL is of the form :

 URL = "http://" + serverName (including port) + requestURI ? queryString
 
requestURI = contextPath + servletPath + pathInfo
From the Servlet 2.2 specification :
  • Context Path: The path prefix associated with the ServletContext that this servlet is a part of. If this context is the default context rooted at the base of the web server's URL namespace, this path will be an empty string. Otherwise, this path starts with a character but does not end with a character.
  • Servlet Path: The path section that directly corresponds to the mapping which activated this request. This path starts with a character.
  • PathInfo: The part of the request path that is not part of the Context Path or the Servlet Path.

Parameters:
  theServerName - the server name (and port) in the URL to simulate,i.e. this is the name that will be returned by theHttpServletRequest.getServerName() andHttpServletRequest.getServerPort().
Parameters:
  theContextPath - the webapp context path in the URL to simulate,i.e. this is the name that will be returned by theHttpServletRequest.getContextPath().Can be null. Format: "/" + name or an empty stringfor the default context.
Parameters:
  theServletPath - the servlet path in the URL to simulate,i.e. this is the name that will be returned by theHttpServletRequest.getServletPath().Can be null. Format : "/" + name.
Parameters:
  thePathInfo - the path info in the URL to simulate, i.e. this isthe name that will be returned by theHttpServletRequest.getPathInfo(). Canbe null. Format : "/" + name.
Parameters:
  theQueryString - the Query string in the URL to simulate, i.e. thisis the string that will be returned by theHttpServletResquest.getQueryString().Can be null.



setUserData
void setUserData(InputStream theDataStream)(Code)
Allow the user to send arbitrary data in the request body
Parameters:
  theDataStream - the stream on which the data are put by the user



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