Class HTTPSampleResult
-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Cloneable,org.apache.jmeter.gui.Searchable
public class HTTPSampleResult extends SampleResultThis is a specialisation of the SampleResult class for the HTTP protocol.
-
-
Field Summary
Fields Modifier and Type Field Description public Stringcookiespublic StringredirectLocationpublic StringqueryStringpublic final static StringDEFAULT_HTTP_ENCODINGpublic final static StringTEXTpublic final static StringBINARYpublic SampleSaveConfigurationsaveConfigpublic SampleResultparentpublic Array<byte>responseDatapublic StringresponseCodepublic StringresultFileNamepublic StringsamplerDatapublic StringthreadNamepublic StringresponseMessagepublic StringresponseHeaderspublic StringrequestHeaderspublic longtimeStamppublic longstartTimepublic longendTimepublic longidleTimepublic StringdataTypepublic StringcontentTypepublic longlatencypublic longconnectTimepublic JMeterContext.TestLogicalActiontestLogicalActionpublic intsampleCountpublic intheadersSizepublic volatile intgroupThreadspublic volatile intallThreadspublic longsentBytespublic transient volatile StringresponseDataAsString
-
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
Modifier and Type Method Description StringgetCookies()voidsetCookies(String string)StringgetRedirectLocation()voidsetRedirectLocation(String redirectLocation)StringgetQueryString()Fetch the query string voidsetQueryString(String string)Save the query string voidsetHTTPMethod(String method)StringgetHTTPMethod()booleanisRedirect()Determine whether this result is a redirect. StringgetSamplerData()Overrides version in Sampler data to provide more details StringgetDataEncodingWithDefault(String defaultEncoding)Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary. StringgetDataEncodingNoDefault()Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary. voidsetResponseNoContent()List<String>getSearchableTokens()-
Methods inherited from class org.apache.jmeter.samplers.SampleResult
addAssertionResult, addRawSubResult, addSubResult, cleanAfterSample, clone, connectEnd, 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, getSamplerData, 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, setBytes, setConnectTime, setContentType, setDataEncoding, setDataType, setEncodingAndType, setEndTime, setErrorCount, setGroupThreads, setHeadersSize, setIdleTime, setIgnore, setLatency, setMonitor, setParent, setRequestHeaders, setResponseCode, setResponseCodeOK, setResponseData, setResponseHeaders, setResponseMessage, setResponseMessageOK, setResponseOK, setResultFileName, setSampleCount, setSampleLabel, setSamplerData, setSaveConfig, setSentBytes, setStampAndTime, setStartNextThreadLoop, setStopTest, setStopTestNow, setStopThread, setSuccessful, setTestLogicalAction, setThreadName, setTimeStamp, setURL, storeSubResult, toDebugString, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HTTPSampleResult
HTTPSampleResult()
-
HTTPSampleResult
HTTPSampleResult(long elapsed)
-
HTTPSampleResult
HTTPSampleResult(HTTPSampleResult res)
Construct a 'parent' result for an already-existing result, essentially cloning it- Parameters:
res- existing sample result
-
-
Method Detail
-
getCookies
String getCookies()
- Returns:
cookies as a string
-
setCookies
void setCookies(String string)
- Parameters:
string- representing the cookies
-
getRedirectLocation
String getRedirectLocation()
-
setRedirectLocation
void setRedirectLocation(String redirectLocation)
-
getQueryString
String getQueryString()
Fetch the query string
- Returns:
the query string
-
setQueryString
void setQueryString(String string)
Save the query string
- Parameters:
string- the query string
-
setHTTPMethod
void setHTTPMethod(String method)
-
getHTTPMethod
String getHTTPMethod()
-
isRedirect
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 ofGETorHEAD, 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
String getSamplerData()
Overrides version in Sampler data to provide more details
-
getDataEncodingWithDefault
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.
- Parameters:
defaultEncoding- Default encoding used if there is no data encoding- Returns:
the dataEncoding value as a String
-
getDataEncodingNoDefault
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.
- Returns:
the dataEncoding value as a String
-
setResponseNoContent
void setResponseNoContent()
-
getSearchableTokens
List<String> getSearchableTokens()
-
-
-
-