|
Apache JMeter 1.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.jmeter.testelement.AbstractTestElement | +--org.apache.jmeter.samplers.AbstractSampler | +--org.apache.jmeter.protocol.http.sampler.HTTPSampler
A sampler which understands all the parts necessary to read statistics about HTTP requests, including cookies and authentication.
Nested Class Summary | |
static class |
HTTPSampler.Test
|
Field Summary | |
static String |
ARGUMENTS
|
static String |
AUTH_MANAGER
|
protected HttpURLConnection |
conn
|
static String |
CONTENT_TYPE
|
static String |
COOKIE_MANAGER
|
static String |
DEFAULT_PROTOCOL
|
static String |
DOMAIN
|
static String |
ENCODED_PATH
|
protected static String |
encoding
|
static String |
FILE_DATA
|
static String |
FILE_FIELD
|
static String |
FILE_MIMETYPE
|
static String |
FILE_NAME
|
static String |
FOLLOW_REDIRECTS
|
static String |
GET
|
static String |
HEADER
|
static String |
HEADER_MANAGER
|
static String |
HEADERS
|
static String |
IMAGE_PARSER
|
static String |
METHOD
|
static String |
MIMETYPE
|
static String |
MULTIPART_FORM
|
protected static String |
NON_HTTP_RESPONSE_CODE
! |
protected static String |
NON_HTTP_RESPONSE_MESSAGE
! |
static String |
NORMAL_FORM
|
static String |
PATH
|
static String |
PORT
|
static String |
POST
|
static String |
PROTOCOL
|
static int |
UNSPECIFIED_PORT
A number to indicate that the port has not been set. |
static String |
URL
|
static String |
USE_KEEPALIVE
|
Fields inherited from class org.apache.jmeter.testelement.AbstractTestElement |
log |
Fields inherited from interface org.apache.jmeter.testelement.TestElement |
ENABLED, GUI_CLASS, NAME, TEST_CLASS |
Constructor Summary | |
HTTPSampler()
Constructor for the HTTPSampler object |
|
HTTPSampler(URL u)
|
Method Summary | |
void |
addArgument(String name,
String value)
|
void |
addArgument(String name,
String value,
String metadata)
|
void |
addEncodedArgument(String name,
String value,
String metaData)
|
void |
addProperty(JMeterProperty prop)
|
void |
addTestElement(TestElement el)
|
protected long |
connect()
|
protected void |
disconnect(HttpURLConnection conn)
|
Arguments |
getArguments()
|
AuthManager |
getAuthManager()
|
CookieManager |
getCookieManager()
|
String |
getDomain()
|
String |
getEncodedPath()
|
String |
getFileField()
|
String |
getFilename()
|
boolean |
getFollowRedirects()
|
HeaderManager |
getHeaderManager()
|
String |
getMethod()
|
String |
getMimetype()
|
String |
getPath()
|
int |
getPort()
|
String |
getProtocol()
|
String |
getQueryString()
Gets the QueryString attribute of the UrlConfig object |
protected byte[] |
getResponseHeaders(HttpURLConnection conn,
SampleResult res)
Gets the ResponseHeaders from the URLConnection, save them to the SampleResults object. |
URL |
getUrl()
! |
boolean |
getUseKeepAlive()
|
boolean |
isImageParser()
|
void |
parseArguments(String queryString)
This method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object. |
protected byte[] |
readResponse(HttpURLConnection conn)
Reads the response from the URL connection |
void |
removeArguments()
|
SampleResult |
sample()
|
SampleResult |
sample(Entry e)
Do a sampling and return its results. |
void |
sendPostData(URLConnection connection)
Send POST data from Entry to the open connection. |
void |
setArguments(Arguments value)
|
void |
setAuthManager(AuthManager value)
|
void |
setCookieManager(CookieManager value)
|
void |
setDomain(String value)
|
void |
setEncodedPath(String path)
|
void |
setFileField(String value)
|
void |
setFilename(String value)
|
void |
setFollowRedirects(boolean value)
|
void |
setHeaderManager(HeaderManager value)
|
void |
setImageParser(boolean parseImages)
|
void |
setMethod(String value)
|
void |
setMimetype(String value)
|
void |
setPath(String path)
Sets the Path attribute of the UrlConfig object |
void |
setPort(int value)
|
void |
setPostHeaders(URLConnection conn)
Set request headers in preparation to opening a connection |
void |
setProperty(JMeterProperty prop)
Sets and overwrites a property in the TestElement. |
void |
setProtocol(String value)
|
protected HttpURLConnection |
setupConnection(URL u,
String method,
SampleResult res)
Returns a HttpURLConnection with request method(GET or POST),
headers, cookies, authorization properly set for the URL request |
void |
setUseKeepAlive(boolean value)
|
String |
toString()
|
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement |
clear, clone, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setRunningVersion, traverse, traverseCollection, traverseMap, traverseProperty |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.jmeter.testelement.TestElement |
clear, clone, getProperty, getPropertyAsBoolean, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setRunningVersion, traverse |
Field Detail |
public static final String HEADERS
public static final String HEADER
public static final String ARGUMENTS
public static final String AUTH_MANAGER
public static final String COOKIE_MANAGER
public static final String HEADER_MANAGER
public static final String MIMETYPE
public static final String DOMAIN
public static final String PORT
public static final String METHOD
public static final String PATH
public static final String FOLLOW_REDIRECTS
public static final String PROTOCOL
public static final String DEFAULT_PROTOCOL
public static final String URL
public static final String POST
public static final String GET
public static final String USE_KEEPALIVE
public static final String FILE_NAME
public static final String FILE_FIELD
public static final String FILE_DATA
public static final String FILE_MIMETYPE
public static final String CONTENT_TYPE
public static final String NORMAL_FORM
public static final String MULTIPART_FORM
public static final String ENCODED_PATH
public static final String IMAGE_PARSER
public static final int UNSPECIFIED_PORT
protected static String encoding
protected transient HttpURLConnection conn
protected static final String NON_HTTP_RESPONSE_CODE
protected static final String NON_HTTP_RESPONSE_MESSAGE
Constructor Detail |
public HTTPSampler()
public HTTPSampler(URL u)
Method Detail |
public void setFileField(String value)
public String getFileField()
public void setFilename(String value)
public String getFilename()
public void setProtocol(String value)
public String getProtocol()
public void setPath(String path)
path
- The new Path valuepublic void setEncodedPath(String path)
public String getEncodedPath()
public void setProperty(JMeterProperty prop)
TestElement
setProperty
in interface TestElement
setProperty
in class AbstractTestElement
public void addProperty(JMeterProperty prop)
addProperty
in class AbstractTestElement
public String getPath()
public void setFollowRedirects(boolean value)
public boolean getFollowRedirects()
public void setMethod(String value)
public String getMethod()
public void setUseKeepAlive(boolean value)
public boolean getUseKeepAlive()
public void addEncodedArgument(String name, String value, String metaData)
public void addArgument(String name, String value)
public void addTestElement(TestElement el)
addTestElement
in interface TestElement
addTestElement
in class AbstractTestElement
public void addArgument(String name, String value, String metadata)
public void setPort(int value)
public int getPort()
public void setDomain(String value)
public String getDomain()
public void setArguments(Arguments value)
public Arguments getArguments()
public void setAuthManager(AuthManager value)
public AuthManager getAuthManager()
public void setHeaderManager(HeaderManager value)
public HeaderManager getHeaderManager()
public void setCookieManager(CookieManager value)
public CookieManager getCookieManager()
public void setMimetype(String value)
public String getMimetype()
public boolean isImageParser()
public void setImageParser(boolean parseImages)
public SampleResult sample(Entry e)
e
- Entry
to be sampled
public SampleResult sample()
public URL getUrl() throws MalformedURLException
MalformedURLException
- !ToDo (Exception description)public String getQueryString()
public void setPostHeaders(URLConnection conn) throws IOException
IOException
- if an I/O exception occurspublic void sendPostData(URLConnection connection) throws IOException
Entry
to the open connection.
connection
- URLConnection
of where POST data should
be sent
IOException
- if an I/O exception occursprotected HttpURLConnection setupConnection(URL u, String method, SampleResult res) throws IOException
HttpURLConnection
with request method(GET or POST),
headers, cookies, authorization properly set for the URL request
u
- URL
of the URL request
HttpURLConnection
of the URL request
IOException
- if an I/O Exception occurspublic void parseArguments(String queryString)
protected byte[] readResponse(HttpURLConnection conn) throws IOException
conn
- URL from which to read response
String
IOException
- if an I/O exception occursprotected byte[] getResponseHeaders(HttpURLConnection conn, SampleResult res) throws IOException
conn
- connection from which the headers are readres
- where the headers read are stored
IOException
public void removeArguments()
protected long connect() throws IOException
IOException
protected void disconnect(HttpURLConnection conn)
public String toString()
toString
in class Object
|
Apache JMeter 1.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |