Class HTTPSampleResult
java.lang.Object
org.apache.jmeter.samplers.SampleResult
org.apache.jmeter.protocol.http.sampler.HTTPSampleResult
- All Implemented Interfaces:
Serializable
,Cloneable
,Searchable
This is a specialisation of the SampleResult class for the HTTP protocol.
- See Also:
-
Field Summary
Fields inherited from class org.apache.jmeter.samplers.SampleResult
BINARY, DEFAULT_ENCODING, DEFAULT_HTTP_ENCODING, TEXT
-
Constructor Summary
ConstructorDescriptionHTTPSampleResult
(long elapsed) Construct a 'parent' result for an already-existing result, essentially cloning it -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary.getDataEncodingWithDefault
(String defaultEncoding) Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary.Fetch the query stringOverrides version in Sampler data to provide more detailsGet a list of all tokens that should be visible to searchingboolean
Determine whether this result is a redirect.void
setCookies
(String string) void
setHTTPMethod
(String method) void
setQueryString
(String string) Save the query stringvoid
setRedirectLocation
(String redirectLocation) void
Methods inherited from class org.apache.jmeter.samplers.SampleResult
addAssertionResult, addRawSubResult, addSubResult, addSubResult, cleanAfterSample, clone, connectEnd, createTestSample, createTestSample, currentTimeInMillis, getAllThreads, getAssertionResults, getBodySize, getBodySizeAsLong, getBytes, getBytesAsLong, getConnectTime, getContentType, getDataEncodingWithDefault, getDataType, getEndTime, getErrorCount, getFirstAssertionFailureMessage, getGroupThreads, getHeadersSize, getIdleTime, getLatency, getMediaType, getParent, getRequestHeaders, getResponseCode, getResponseData, getResponseDataAsString, getResponseHeaders, getResponseMessage, getResultFileName, getSampleCount, getSampleLabel, getSampleLabel, getSaveConfig, getSentBytes, getStartTime, getSubResults, getTestLogicalAction, getThreadName, getTime, getTimeStamp, getURL, getUrlAsString, isBinaryType, isIgnore, isMonitor, isRenameSampleLabel, isResponseCodeOK, isStampedAtStart, isStartNextThreadLoop, isStopTest, isStopTestNow, isStopThread, isSuccessful, latencyEnd, markFile, removeAssertionResults, removeSubResults, sampleEnd, samplePause, sampleResume, sampleStart, setAllThreads, setBodySize, setBodySize, setBytes, setBytes, setConnectTime, setContentType, setDataEncoding, setDataType, setEncodingAndType, setEndTime, setErrorCount, setGroupThreads, setHeadersSize, setIdleTime, setIgnore, setLatency, setMonitor, setParent, setRequestHeaders, setResponseCode, setResponseCodeOK, setResponseData, setResponseData, setResponseData, setResponseHeaders, setResponseMessage, setResponseMessageOK, setResponseOK, setResultFileName, setSampleCount, setSampleLabel, setSamplerData, setSaveConfig, setSentBytes, setStampAndTime, setStartNextThreadLoop, setStartTime, setStopTest, setStopTestNow, setStopThread, setSuccessful, setTestLogicalAction, setThreadName, setTimeStamp, setURL, storeSubResult, storeSubResult, toDebugString, toString
-
Constructor Details
-
HTTPSampleResult
public HTTPSampleResult() -
HTTPSampleResult
public HTTPSampleResult(long elapsed) -
HTTPSampleResult
Construct a 'parent' result for an already-existing result, essentially cloning it- Parameters:
res
- existing sample result
-
-
Method Details
-
setHTTPMethod
-
getHTTPMethod
-
setRedirectLocation
-
getRedirectLocation
-
isRedirect
public boolean isRedirect()Determine whether this result is a redirect.If status is
Returns true for: 301, 302, 303, 307 (GET or HEAD) and 308307
, the request has to be a HTTP method ofGET
orHEAD
, to be considered a redirect. For all other status codes, the HTTP method will not be checked.- Returns:
- true iff res is an HTTP redirect response
-
getSamplerData
Overrides version in Sampler data to provide more details- Overrides:
getSamplerData
in classSampleResult
-
getCookies
- Returns:
- cookies as a string
-
setCookies
- Parameters:
string
- representing the cookies
-
getQueryString
Fetch the query string- Returns:
- the query string
-
setQueryString
Save the query string- Parameters:
string
- the query string
-
getDataEncodingWithDefault
Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary. Updates the dataEncoding field if the content-type is found.- Overrides:
getDataEncodingWithDefault
in classSampleResult
- Parameters:
defaultEncoding
- Default encoding used if there is no data encoding- Returns:
- the dataEncoding value as a String
-
getDataEncodingNoDefault
Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary. Updates the dataEncoding field if the content-type is found.- Overrides:
getDataEncodingNoDefault
in classSampleResult
- Returns:
- the dataEncoding value as a String
-
setResponseNoContent
public void setResponseNoContent() -
getSearchableTokens
Description copied from interface:Searchable
Get a list of all tokens that should be visible to searching- Specified by:
getSearchableTokens
in interfaceSearchable
- Overrides:
getSearchableTokens
in classSampleResult
- Returns:
- List of searchable tokens
- Throws:
Exception
- when something fails while getting the searchable tokens
-
appendDebugParameters
- Overrides:
appendDebugParameters
in classSampleResult
-