|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cactus.BaseWebRequest
Contains all HTTP request data for a test case but independently of the fact that there is or there is not a Cactus redirector. It is the data that will be sent to the server side.
Field Summary | |
static java.lang.String |
GET_METHOD
GET Method identifier. |
static java.lang.String |
POST_METHOD
POST Method identifier. |
Constructor Summary | |
BaseWebRequest()
Default constructor that requires that setConfiguration(Configuration) be called before the methods
requiring a configuration object. |
|
BaseWebRequest(Configuration theConfiguration)
|
Method Summary | |
void |
addCookie(Cookie theCookie)
Adds a cookie to the request. |
void |
addCookie(java.lang.String theName,
java.lang.String theValue)
Adds a cookie to the request. |
void |
addCookie(java.lang.String theDomain,
java.lang.String theName,
java.lang.String theValue)
Adds a cookie to the request. |
void |
addHeader(java.lang.String theName,
java.lang.String theValue)
Adds a header to the request. |
void |
addParameter(java.lang.String theName,
java.lang.String theValue)
Adds a parameter to the request. |
void |
addParameter(java.lang.String theName,
java.lang.String theValue,
java.lang.String theMethod)
Adds a parameter to the request. |
Authentication |
getAuthentication()
|
protected Configuration |
getConfiguration()
|
java.lang.String |
getContentType()
|
java.util.Vector |
getCookies()
|
java.lang.String |
getHeader(java.lang.String theName)
Returns the first value corresponding to this header's name. |
java.util.Enumeration |
getHeaderNames()
|
java.lang.String[] |
getHeaderValues(java.lang.String theName)
Returns all the values associated with this header's name. |
java.lang.String |
getParameterGet(java.lang.String theName)
Returns the first value corresponding to this parameter's name (provided this parameter is passed in the URL). |
java.util.Enumeration |
getParameterNamesGet()
|
java.util.Enumeration |
getParameterNamesPost()
|
java.lang.String |
getParameterPost(java.lang.String theName)
Returns the first value corresponding to this parameter's name (provided this parameter is passed in the request body - POST). |
java.lang.String[] |
getParameterValuesGet(java.lang.String theName)
Returns all the values corresponding to this parameter's name (provided this parameter is passed in the URL). |
java.lang.String[] |
getParameterValuesPost(java.lang.String theName)
Returns all the values corresponding to this parameter's name (provided this parameter is passed in the request body - POST). |
java.io.InputStream |
getUserData()
|
void |
setAuthentication(Authentication theAuthentication)
Sets the authentication object that will configure the http request |
void |
setConfiguration(Configuration theConfiguration)
|
void |
setContentType(java.lang.String theContentType)
Sets the content type that will be set in the http request |
void |
setUserData(java.io.InputStream theDataStream)
Allow the user to send arbitrary data in the request body |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String GET_METHOD
public static final java.lang.String POST_METHOD
Constructor Detail |
public BaseWebRequest()
setConfiguration(Configuration)
be called before the methods
requiring a configuration object.
public BaseWebRequest(Configuration theConfiguration)
theConfiguration
- the Cactus configurationMethod Detail |
protected Configuration getConfiguration()
public void setConfiguration(Configuration theConfiguration)
theConfiguration
- the cactus configuration to assign to this
requestpublic void setContentType(java.lang.String theContentType)
theContentType
- the content typepublic java.lang.String getContentType()
public void setUserData(java.io.InputStream theDataStream)
theDataStream
- the stream on which the data are put by the userpublic java.io.InputStream getUserData()
public void addParameter(java.lang.String theName, java.lang.String theValue, java.lang.String theMethod)
HttpServletRequest
).
theName
- the parameter's nametheValue
- the parameter's valuetheMethod
- GET_METHOD or POST_METHOD. If GET_METHOD then the
parameter will be sent in the query string of the URL. If
POST_METHOD, it will be sent as a parameter in the request body.public void addParameter(java.lang.String theName, java.lang.String theValue)
theName
- the parameter's nametheValue
- the parameter's valueaddParameter(String, String, String)
public java.util.Enumeration getParameterNamesPost()
public java.util.Enumeration getParameterNamesGet()
public java.lang.String getParameterGet(java.lang.String theName)
theName
- the parameter's name
public java.lang.String getParameterPost(java.lang.String theName)
theName
- the parameter's name
public java.lang.String[] getParameterValuesGet(java.lang.String theName)
theName
- the parameter's name
public java.lang.String[] getParameterValuesPost(java.lang.String theName)
theName
- the parameter's name
public void addCookie(java.lang.String theName, java.lang.String theValue)
addCookie(String, String, String)
method or the method
addCookie(Cookie)
.
theName
- the cookie's nametheValue
- the cookie's valuepublic void addCookie(java.lang.String theDomain, java.lang.String theName, java.lang.String theValue)
cactus.properties
) or the host set
using setURL()
.
theDomain
- the cookie domaintheName
- the cookie nametheValue
- the cookie valuepublic void addCookie(Cookie theCookie)
cactus.properties
) or the host set
using setURL()
.
theCookie
- the cookie to addpublic java.util.Vector getCookies()
Cookie
objects)public void addHeader(java.lang.String theName, java.lang.String theValue)
theName
- the header's nametheValue
- the header's valuepublic java.util.Enumeration getHeaderNames()
public java.lang.String getHeader(java.lang.String theName)
theName
- the header's name
public java.lang.String[] getHeaderValues(java.lang.String theName)
theName
- the header's name
public java.lang.String toString()
public void setAuthentication(Authentication theAuthentication)
theAuthentication
- the authentication objectpublic Authentication getAuthentication()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |