|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.samplers.AbstractSampler
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
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 |
Fields inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase |
ARGUMENTS, AUTH_MANAGER, AUTO_REDIRECTS, CONTENT_TYPE, COOKIE_MANAGER, DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT, DEFAULT_PROTOCOL, DOMAIN, FILE_DATA, FILE_FIELD, FILE_MIMETYPE, FILE_NAME, FOLLOW_REDIRECTS, GET, HEADER_MANAGER, IMAGE_PARSER, MAX_FRAME_DEPTH, MAX_REDIRECTS, METHOD, MIMETYPE, MONITOR, MULTIPART_FORM, NON_HTTP_RESPONSE_CODE, NON_HTTP_RESPONSE_MESSAGE, NORMAL_FORM, PATH, PORT, POST, PROTOCOL, UNSPECIFIED_PORT, URL, USE_KEEPALIVE |
Fields inherited from interface org.apache.jmeter.testelement.TestElement |
ENABLED, GUI_CLASS, NAME, TEST_CLASS |
Constructor Summary | |
HTTPSampler()
Constructor for the HTTPSampler object. |
Method Summary | |
protected void |
disconnect(HttpURLConnection conn)
|
protected String |
getResponseHeaders(HttpURLConnection conn)
Gets the ResponseHeaders from the URLConnection |
protected void |
modifyHeaderValues(HttpURLConnection conn,
int headerIndex,
StringBuffer resultBuf)
|
protected byte[] |
readResponse(HttpURLConnection conn)
Reads the response from the URL connection. |
protected HTTPSampleResult |
sample(URL url,
String method,
boolean areFollowingRedirect,
int frameDepth)
Samples the URL passed in and stores the result in HTTPSampleResult , following redirects and downloading
page resources as appropriate.
|
void |
sendPostData(URLConnection connection)
Send POST data from Entry to the open connection. |
void |
setPostHeaders(URLConnection conn)
Set request headers in preparation to opening a connection. |
protected HttpURLConnection |
setupConnection(URL u,
String method,
HTTPSampleResult res)
Returns an HttpURLConnection fully ready to attempt
connection. |
Methods inherited from class org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase |
addArgument, addArgument, addEncodedArgument, addTestElement, clone, downloadPageResources, encodeSpaces, errorResult, getArguments, getAuthManager, getCookieManager, getDomain, getFileField, getFilename, getFollowRedirects, getHeaderManager, getMethod, getMimetype, getMonitor, getPath, getPort, getProtocol, getQueryString, getUrl, getUseKeepAlive, isImageParser, isMonitor, parseArguments, sample, sample, setArguments, setAuthManager, setCookieManager, setDomain, setFileField, setFilename, setFollowRedirects, setHeaderManager, setImageParser, setMethod, setMimetype, setMonitor, setPath, setPort, setProtocol, setUseKeepAlive, testEnded, testEnded, testIterationStart, testStarted, testStarted, toString |
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement |
addProperty, canRemove, clear, clearTemporary, emptyTemporary, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isRunningVersion, isTemporary, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, 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 |
canRemove, clear, getProperty, getPropertyAsBoolean, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse |
Constructor Detail |
public HTTPSampler()
Method Detail |
public void setPostHeaders(URLConnection conn) throws IOException
conn
- URLConnection
to set headers on
IOException
- if an I/O exception occurspublic void sendPostData(URLConnection connection) throws IOException
Entry
to the open connection.
connection
- URLConnection
where POST data should
be sent
IOException
- if an I/O exception occursprotected HttpURLConnection setupConnection(URL u, String method, HTTPSampleResult res) throws IOException
HttpURLConnection
fully ready to attempt
connection. This means it sets the request method (GET or
POST), headers, cookies, and authorization for the URL request.
The request infos are saved into the sample result if one is provided.
u
- URL
of the URL requestmethod
- http/httpsres
- sample result to save request infos to
HttpURLConnection
ready for .connect
IOException
- if an I/O Exception occursprotected byte[] readResponse(HttpURLConnection conn) throws IOException
conn
- URL from which to read response
IOException
- if an I/O exception occursprotected String getResponseHeaders(HttpURLConnection conn) throws IOException
conn
- connection from which the headers are read
IOException
protected void modifyHeaderValues(HttpURLConnection conn, int headerIndex, StringBuffer resultBuf)
conn
- connectionheaderIndex
- which header to useresultBuf
- output string bufferprotected HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth)
HTTPSampleResult
, following redirects and downloading
page resources as appropriate.
When getting a redirect target, redirects are not followed and resources are not downloaded. The caller will take care of this.
sample
in class HTTPSamplerBase
url
- URL to samplemethod
- HTTP method: GET, POST,...areFollowingRedirect
- whether we're getting a redirect targetframeDepth
- Depth of this target in the frame structure.
Used only to prevent infinite recursion.
protected void disconnect(HttpURLConnection conn)
|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |