Class HTTPSampleResult
- java.lang.Object
-
- org.apache.jmeter.samplers.SampleResult
-
- org.apache.jmeter.protocol.http.sampler.HTTPSampleResult
-
- All Implemented Interfaces:
Serializable,Cloneable
public class HTTPSampleResult extends SampleResult
This is a specialisation of the SampleResult class for the HTTP protocol.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.jmeter.samplers.SampleResult
BINARY, DEFAULT_ENCODING, DEFAULT_HTTP_ENCODING, EMPTY_BA, TEXT
-
-
Constructor Summary
Constructors Constructor Description HTTPSampleResult()HTTPSampleResult(long elapsed)HTTPSampleResult(HTTPSampleResult res)Construct a 'parent' result for an already-existing result, essentially cloning it
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCookies()StringgetDataEncodingNoDefault()Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary.StringgetDataEncodingWithDefault(String defaultEncoding)Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary.StringgetHTTPMethod()StringgetQueryString()Fetch the query stringStringgetRedirectLocation()StringgetSamplerData()Overrides version in Sampler data to provide more detailsbooleanisRedirect()Determine whether this result is a redirect.voidsetCookies(String string)voidsetHTTPMethod(String method)voidsetQueryString(String string)Save the query stringvoidsetRedirectLocation(String redirectLocation)voidsetResponseNoContent()-
Methods inherited from class org.apache.jmeter.samplers.SampleResult
addAssertionResult, addRawSubResult, addSubResult, cleanAfterSample, clone, connectEnd, createTestSample, createTestSample, currentTimeInMillis, getAllThreads, getAssertionResults, getBodySize, getBytes, getConnectTime, getContentType, getDataEncodingWithDefault, getDataType, getEndTime, getErrorCount, getGroupThreads, getHeadersSize, getIdleTime, getLatency, getMediaType, getParent, getRequestHeaders, getResponseCode, getResponseData, getResponseDataAsString, getResponseHeaders, getResponseMessage, getResultFileName, getSampleCount, getSampleLabel, getSampleLabel, getSaveConfig, getStartTime, getSubResults, getThreadName, getTime, getTimeStamp, getURL, getUrlAsString, isMonitor, isResponseCodeOK, isStampedAtStart, isStartNextThreadLoop, isStopTest, isStopTestNow, isStopThread, isSuccessful, latencyEnd, markFile, removeAssertionResults, removeSubResults, sampleEnd, samplePause, sampleResume, sampleStart, setAllThreads, setBodySize, setBytes, setConnectTime, setContentType, setDataEncoding, setDataType, setEncodingAndType, setEndTime, setErrorCount, setGroupThreads, setHeadersSize, setIdleTime, setLatency, setMonitor, setParent, setRequestHeaders, setResponseCode, setResponseCodeOK, setResponseData, setResponseData, setResponseData, setResponseHeaders, setResponseMessage, setResponseMessageOK, setResponseOK, setResultFileName, setSampleCount, setSampleLabel, setSamplerData, setSaveConfig, setStampAndTime, setStartNextThreadLoop, setStartTime, setStopTest, setStopTestNow, setStopThread, setSuccessful, setThreadName, setTimeStamp, setURL, storeSubResult, toString
-
-
-
-
Constructor Detail
-
HTTPSampleResult
public HTTPSampleResult()
-
HTTPSampleResult
public HTTPSampleResult(long elapsed)
-
HTTPSampleResult
public HTTPSampleResult(HTTPSampleResult res)
Construct a 'parent' result for an already-existing result, essentially cloning it- Parameters:
res- existing sample result
-
-
Method Detail
-
setHTTPMethod
public void setHTTPMethod(String method)
-
getHTTPMethod
public String getHTTPMethod()
-
setRedirectLocation
public void setRedirectLocation(String redirectLocation)
-
getRedirectLocation
public String getRedirectLocation()
-
isRedirect
public boolean isRedirect()
Determine whether this result is a redirect. Returns true for: 301,302,303 and 307(GET or HEAD)- Returns:
- true iff res is an HTTP redirect response
-
getSamplerData
public String getSamplerData()
Overrides version in Sampler data to provide more details- Overrides:
getSamplerDatain classSampleResult
-
getCookies
public String getCookies()
- Returns:
- cookies as a string
-
setCookies
public void setCookies(String string)
- Parameters:
string- representing the cookies
-
getQueryString
public String getQueryString()
Fetch the query string- Returns:
- the query string
-
setQueryString
public void setQueryString(String string)
Save the query string- Parameters:
string- the query string
-
getDataEncodingWithDefault
public String getDataEncodingWithDefault(String defaultEncoding)
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:
getDataEncodingWithDefaultin classSampleResult- Parameters:
defaultEncoding- Default encoding used if there is no data encoding- Returns:
- the dataEncoding value as a String
-
getDataEncodingNoDefault
public 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:
getDataEncodingNoDefaultin classSampleResult- Returns:
- the dataEncoding value as a String
-
setResponseNoContent
public void setResponseNoContent()
-
-