Class HTTPSampleResult

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , org.apache.jmeter.gui.Searchable

    
    public class HTTPSampleResult
    extends SampleResult
                        

    This is a specialisation of the SampleResult class for the HTTP protocol.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getCookies()
      void setCookies(String string)
      String getRedirectLocation()
      void setRedirectLocation(String redirectLocation)
      String getQueryString() Fetch the query string
      void setQueryString(String string) Save the query string
      void setHTTPMethod(String method)
      String getHTTPMethod()
      boolean isRedirect() Determine whether this result is a redirect.
      String getSamplerData() Overrides version in Sampler data to provide more details
      String getDataEncodingWithDefault(String defaultEncoding) Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary.
      String getDataEncodingNoDefault() Overrides the method from SampleResult - so the encoding can be extracted from the Meta content-type if necessary.
      void setResponseNoContent()
      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

      • setCookies

         void setCookies(String string)
        Parameters:
        string - representing the cookies
      • setQueryString

         void setQueryString(String string)

        Save the query string

        Parameters:
        string - the query string
      • isRedirect

         boolean isRedirect()

        Determine whether this result is a redirect.

        If status is 307, the request has to be a HTTP method of GET or HEAD, to be considered a redirect. For all other status codes, the HTTP method will not be checked.

        Returns true for: 301, 302, 303, 307 (GET or HEAD) and 308
        Returns:

        true iff res is an HTTP redirect response

      • 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