public class RequestTag
extends org.apache.commons.jelly.TagSupport
Modifier and Type | Field and Description |
---|---|
protected boolean |
_followRedirects |
protected java.lang.String |
_host |
protected java.lang.String |
_httpVersion |
protected java.lang.String |
_label |
protected static org.apache.log4j.Category |
_log |
protected int |
_method |
protected java.lang.String |
_path |
protected int |
_port |
protected java.lang.String |
_proxyHost |
protected int |
_proxyPort |
protected Request |
_request |
protected boolean |
_requestExecuted |
protected Response |
_response |
protected boolean |
_secure |
protected Session |
_session |
Constructor and Description |
---|
RequestTag() |
Modifier and Type | Method and Description |
---|---|
void |
doTag(org.apache.commons.jelly.XMLOutput xmlOutput)
Wraps Latka tests, provides some defaults for host, port etc.
|
protected Session |
findSession() |
Request |
getRequest() |
boolean |
getRequestExecuted() |
Response |
getResponse()
The first time this method is called, a live HTTP
call will be made to the server, returning null
if the response cannot be obtained.
|
protected SuiteSettings |
getSuiteSettings()
get the suite settings from SuiteTag
|
void |
setFollowRedirects(java.lang.String followRedirects)
Sets whether or not to transmit the request over
SSL.
|
void |
setHost(java.lang.String host)
Setter for host
|
void |
setLabel(java.lang.String label)
Set the label for this suite
|
void |
setMethod(java.lang.String method)
Sets the HTTP method to use.
|
void |
setPath(java.lang.String path)
Sets the path of the document on the server, combined
with the host and port
|
void |
setPort(int port)
Setter for port
|
void |
setProxyHost(java.lang.String host)
Setter for defaultProxyHost
|
void |
setProxyPort(int port)
Setter for defaultProxyPort
|
void |
setSecure(java.lang.String secure)
Sets whether or not to transmit the request over
SSL.
|
void |
setVersion(java.lang.String version)
HTTP version to use.
|
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
protected java.lang.String _host
protected int _port
protected java.lang.String _proxyHost
protected int _proxyPort
protected java.lang.String _label
protected int _method
protected java.lang.String _path
protected boolean _secure
protected boolean _followRedirects
protected java.lang.String _httpVersion
protected Request _request
protected Response _response
protected Session _session
protected boolean _requestExecuted
protected static final org.apache.log4j.Category _log
public void doTag(org.apache.commons.jelly.XMLOutput xmlOutput) throws org.apache.commons.jelly.JellyTagException
xmlOutput
- a place to write outputorg.apache.commons.jelly.JellyTagException
- if an HTTP request could not be createdpublic Request getRequest()
protected Session findSession()
public boolean getRequestExecuted()
public Response getResponse() throws LatkaException
LatkaException
- error creating the Request (unrecoverable)protected SuiteSettings getSuiteSettings()
public void setHost(java.lang.String host)
host
- host for the requestpublic void setPort(int port)
port
- port for all requestspublic void setProxyHost(java.lang.String host)
defaultHost
- defaultProxyHost for all requestspublic void setProxyPort(int port)
defaultPort
- defaultProxyPort for all requestspublic void setLabel(java.lang.String label)
label
- suite labelpublic void setMethod(java.lang.String method) throws java.lang.UnsupportedOperationException
method
- set method to post, get or headjava.lang.UnsupportedOperationException
- if an unsupported HTTP method is setpublic void setPath(java.lang.String path)
path
- Path to the document on the serverpublic void setSecure(java.lang.String secure)
secure
- whether or not this request is SSLpublic void setFollowRedirects(java.lang.String followRedirects)
secure
- whether or not this request is SSLpublic void setVersion(java.lang.String version)
version
- HTTP specification versionCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.