Class HTTPSamplerBase
- All Implemented Interfaces:
- Serializable,- Cloneable,- ConfigMergabilityIndicator,- Replaceable,- Searchable,- HTTPConstantsInterface,- Sampler,- org.apache.jmeter.testelement.TestElement,- TestIterationListener,- TestStateListener,- ThreadListener
- Direct Known Subclasses:
- AjpSampler,- HTTPSampler,- HTTPSamplerProxy
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final StringThis is the encoding used for the content, i.e.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringIP source to use - does not apply to Java HTTP implementation currentlystatic final Stringstatic final Stringprotected static final intprotected static final intstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intA number to indicate that the port has not been set.static final Stringstatic final Stringstatic final intIf the port is not present in a URL, getPort() returns -1static final Stringstatic final StringFields inherited from interface org.apache.jmeter.protocol.http.util.HTTPConstantsInterfaceAPPLICATION_X_WWW_FORM_URLENCODED, CACHE_CONTROL, CONNECT, CONNECTION_CLOSE, COPY, DATE, DEFAULT_HTTP_PORT, DEFAULT_HTTP_PORT_STRING, DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_PORT_STRING, DELETE, ENCODING_BROTLI, ENCODING_DEFLATE, ENCODING_GZIP, ETAG, EXPIRES, GET, HEAD, HEADER_AUTHORIZATION, HEADER_CONNECTION, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, HEADER_COOKIE_IN_REQUEST, HEADER_HOST, HEADER_LOCAL_ADDRESS, HEADER_LOCATION, HEADER_SET_COOKIE, HTTP_1_1, IF_MODIFIED_SINCE, IF_NONE_MATCH, KEEP_ALIVE, LAST_MODIFIED, LOCK, MKCALENDAR, MKCOL, MOVE, MULTIPART_FORM_DATA, OPTIONS, PATCH, POST, PROPFIND, PROPPATCH, PROTOCOL_HTTP, PROTOCOL_HTTPS, PUT, REPORT, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_PERMANENT_REDIRECT, SC_SEE_OTHER, SC_TEMPORARY_REDIRECT, SEARCH, TRACE, TRANSFER_ENCODING, UNLOCK, VARYFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddArgument(String name, String value) voidaddArgument(String name, String value, String metadata) voidaddEncodedArgument(String name, String value) Add an argument which has already been encodedvoidaddEncodedArgument(String name, String value, String metaData) voidaddEncodedArgument(String name, String value, String metaData, String contentEncoding) Creates an HTTPArgument and adds it to the current setgetArguments()of arguments.voidaddNonEncodedArgument(String name, String value, String metadata) voidaddNonEncodedArgument(String name, String value, String metadata, String contentType) voidaddTestElement(org.apache.jmeter.testelement.TestElement el) booleanapplies(ConfigTestElement configElement) Does configElement apply to Samplervoidprotected HTTPSampleResultdownloadPageResources(HTTPSampleResult pRes, HTTPSampleResult container, int frameDepth) Download the resources of an HTML page.protected static StringencodeBackSlashes(String value) protected StringencodeSpaces(String path) protected HTTPSampleResulterrorResult(Throwable e, HTTPSampleResult res) Populates the provided HTTPSampleResult with details from the Exception.protected HTTPSampleResultfollowRedirects(HTTPSampleResult res, int frameDepth) Iteratively download the redirect targets of a redirect response.booleanGet the pool size for concurrent thread pool to get embedded resources.intstatic intgetDefaultPort(String protocol, int port) Get the port number for a URL, applying defaults if necessary.booleanbooleanbooleanDeprecated.Get the regular expression URLs must match.booleanintGet the collection of files as a list.get IP source to use - does not apply to Java HTTP implementation currentlyintget IP/address source type to useDeprecated.since 3.2 always returns falsegetPath()intgetPort()Get the port; apply the default for the protocol if necessary.intGet the port number from the port string, allowing for trailing blanks.booleanorg.apache.jmeter.testelement.schema.PropertiesAccessor<? extends HTTPSamplerBase,? extends org.apache.jmeter.protocol.http.sampler.HTTPSamplerBaseSchema> getProps()Gets the protocol, with default.intGets the QueryString attribute of the UrlConfig object, using UTF-8 to encode the URLgetQueryString(String contentEncoding) Gets the QueryString attribute of the UrlConfig object, using the specified encoding to encode the parameter values put into the URLintorg.apache.jmeter.protocol.http.sampler.HTTPSamplerBaseSchemabooleanDetermine if the file should be sent as the entire Content body, i.e.booleanDetermine if none of the parameters have a name, and if that is the case, it means that the parameter values should be sent as the entity bodystatic String[]getUrl()Get the URL, built from its component parts.booleanbooleanDetermine if we should use multipart/form-data or application/x-www-form-urlencoded for the postbooleanDetermine if we should use multipart/form-data or application/x-www-form-urlencoded for the poststatic String[]booleanbooleanReturn if used a concurrent thread pool to get embedded resources.booleanbooleanDeprecated.since 3.2 always returns falsebooleanTell whether the default port for the specified protocol is usedstatic booleanstatic booleanprotected booleanisSuccessCode(int code) Determine if the HTTP status code is successful or not i.e.voidparseArguments(String queryString) voidparseArguments(String queryString, String contentEncoding) This method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object.byte[]readResponse(SampleResult sampleResult, InputStream in, long length) Read response from the input stream, converting to MD5 digest if the useMD5 property is set.intReplace by replaceBy in path and body (arguments) propertiesprotected HTTPSampleResultresultProcessing(boolean pAreFollowingRedirect, int frameDepth, HTTPSampleResult pRes) Follow redirects and download page resources if appropriate.sample()Perform a sample, and return the resultsprotected abstract HTTPSampleResultSamples the URL passed in and stores the result inHTTPSampleResult, following redirects and downloading page resources as appropriate.Do a sampling and return its results.final voidsetArguments(Arguments value) voidsetAuthManager(AuthManager value) voidsetAutoRedirects(boolean value) voidsetCacheManager(CacheManager value) voidsetConcurrentDwn(boolean concurrentDwn) voidsetConcurrentPool(String poolSize) voidsetConnectTimeout(String value) voidsetContentEncoding(String charsetName) Sets the value of the encoding to be used for the content.voidsetCookieManager(CookieManager value) voidsetDNSResolver(DNSCacheManager cacheManager) voidsetDoBrowserCompatibleMultipart(boolean value) voidvoidsetDoMultipart(boolean value) voidsetDoMultipartPost(boolean value) Deprecated.voidsetEmbeddedUrlExcludeRE(String regex) voidsetEmbeddedUrlRE(String regex) voidsetFollowRedirects(boolean value) voidsetHeaderManager(HeaderManager value) voidsetHTTPFiles(HTTPFileArg[] files) Saves the list of files.voidsetImageParser(boolean parseImages) voidsetImplementation(String value) voidsetIpSource(String value) set IP source to use - does not apply to Java HTTP implementation currentlyvoidsetIpSourceType(int value) set IP/address source type to usevoidsetKeystoreConfig(KeystoreConfig value) voidsetMD5(boolean value) voidvoidsetMonitor(boolean truth) voidsetMonitor(String value) voidSets the Path attribute of the UrlConfig object Also calls parseArguments to extract and store any query argumentsvoidSets the PATH property; if the request is a GET or DELETE (and the path does not start with http[s]://) it also callsparseArguments(String, String)to extract and store any query arguments.voidsetPort(int value) voidsetPostBodyRaw(boolean value) voidsetProtocol(String value) voidsetProxyHost(String host) voidsetProxyPass(String pass) voidsetProxyPortInt(String port) voidsetProxyScheme(String schema) voidsetProxyUser(String user) voidsetResponseTimeout(String value) voidsetUseKeepAlive(boolean value) voidCalled once for all threads after the end of a test.voidCalled once for all threads after the end of a test.voidEach time through a Thread Group's test script, an iteration event is fired for each thread.voidCalled just before the start of the test from the main engine thread.voidtestStarted(String host) Called just before the start of the test from the main engine thread.voidCalled for each thread after all samples have been processed.voidCalled for each thread before starting sampling.toString()booleanuseMD5()Methods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementcanRemove, clear, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, removeProperty, set, set, set, set, set, set, set, set, set, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
- 
Field Details- 
ARGUMENTS- See Also:
 
- 
AUTH_MANAGER- See Also:
 
- 
COOKIE_MANAGER- See Also:
 
- 
KEYSTORE_CONFIG- See Also:
 
- 
SAMPLE_TIMEOUT- See Also:
 
- 
CACHE_MANAGER- See Also:
 
- 
HEADER_MANAGER- See Also:
 
- 
DNS_CACHE_MANAGER- See Also:
 
- 
DOMAIN- See Also:
 
- 
PORT- See Also:
 
- 
PROXYSCHEME- See Also:
 
- 
PROXYHOST- See Also:
 
- 
PROXYPORT- See Also:
 
- 
PROXYUSER- See Also:
 
- 
PROXYPASS- See Also:
 
- 
CONNECT_TIMEOUT- See Also:
 
- 
RESPONSE_TIMEOUT- See Also:
 
- 
METHOD- See Also:
 
- 
CONTENT_ENCODINGThis is the encoding used for the content, i.e. the charset name, not the header "Content-Encoding"- See Also:
 
- 
IMPLEMENTATION- See Also:
 
- 
PATH- See Also:
 
- 
FOLLOW_REDIRECTS
- 
AUTO_REDIRECTS- See Also:
 
- 
PROTOCOL- See Also:
 
- 
URL- See Also:
 
- 
IP_SOURCEIP source to use - does not apply to Java HTTP implementation currently- See Also:
 
- 
IP_SOURCE_TYPE- See Also:
 
- 
USE_KEEPALIVE- See Also:
 
- 
DO_MULTIPART_POST- See Also:
 
- 
BROWSER_COMPATIBLE_MULTIPART- See Also:
 
- 
CONCURRENT_DWN- See Also:
 
- 
CONCURRENT_POOL- See Also:
 
- 
CONCURRENT_POOL_SIZEpublic static final int CONCURRENT_POOL_SIZE- See Also:
 
- 
BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULTpublic static final boolean BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT- See Also:
 
- 
SOURCE_TYPE_DEFAULTpublic static final int SOURCE_TYPE_DEFAULT
- 
DEFAULT_METHOD- See Also:
 
- 
CONTENT_TYPE- See Also:
 
- 
IMAGE_PARSER- See Also:
 
- 
EMBEDDED_URL_RE- See Also:
 
- 
EMBEDDED_URL_EXCLUDE_RE- See Also:
 
- 
MONITOR- See Also:
 
- 
MD5- See Also:
 
- 
UNSPECIFIED_PORTpublic static final int UNSPECIFIED_PORTA number to indicate that the port has not been set.- See Also:
 
- 
UNSPECIFIED_PORT_AS_STRING- See Also:
 
- 
URL_UNSPECIFIED_PORTpublic static final int URL_UNSPECIFIED_PORTIf the port is not present in a URL, getPort() returns -1- See Also:
 
- 
URL_UNSPECIFIED_PORT_AS_STRING- See Also:
 
- 
NON_HTTP_RESPONSE_CODE- See Also:
 
- 
NON_HTTP_RESPONSE_MESSAGE- See Also:
 
- 
POST_BODY_RAW- See Also:
 
- 
POST_BODY_RAW_DEFAULTpublic static final boolean POST_BODY_RAW_DEFAULT- See Also:
 
- 
MAX_REDIRECTSprotected static final int MAX_REDIRECTS
- 
MAX_FRAME_DEPTHprotected static final int MAX_FRAME_DEPTH
 
- 
- 
Constructor Details- 
HTTPSamplerBaseprotected HTTPSamplerBase()
 
- 
- 
Method Details- 
getSchemapublic org.apache.jmeter.protocol.http.sampler.HTTPSamplerBaseSchema getSchema()- Specified by:
- getSchemain interface- org.apache.jmeter.testelement.TestElement
 
- 
getPropspublic org.apache.jmeter.testelement.schema.PropertiesAccessor<? extends HTTPSamplerBase,? extends org.apache.jmeter.protocol.http.sampler.HTTPSamplerBaseSchema> getProps()- Specified by:
- getPropsin interface- org.apache.jmeter.testelement.TestElement
 
- 
getSourceTypeList
- 
getSendFileAsPostBodypublic boolean getSendFileAsPostBody()Determine if the file should be sent as the entire Content body, i.e. without any additional wrapping.- Returns:
- true if specified file is to be sent as the body, i.e. there is a single file entry which has a non-empty path and an empty Parameter name.
 
- 
getSendParameterValuesAsPostBodypublic boolean getSendParameterValuesAsPostBody()Determine if none of the parameters have a name, and if that is the case, it means that the parameter values should be sent as the entity body- Returns:
- trueif there are parameters and none of these have a name specified, or- getPostBodyRaw()returns- true
 
- 
getUseMultipartForPostpublic boolean getUseMultipartForPost()Determine if we should use multipart/form-data or application/x-www-form-urlencoded for the post- Returns:
- true if multipart/form-data should be used and method is POST
 
- 
getUseMultipartpublic boolean getUseMultipart()Determine if we should use multipart/form-data or application/x-www-form-urlencoded for the post- Returns:
- true if multipart/form-data should be used and method is POST
 
- 
setProtocol
- 
getProtocolGets the protocol, with default.- Returns:
- the protocol
 
- 
setPathSets the Path attribute of the UrlConfig object Also calls parseArguments to extract and store any query arguments- Parameters:
- path- The new Path value
 
- 
setPathSets the PATH property; if the request is a GET or DELETE (and the path does not start with http[s]://) it also callsparseArguments(String, String)to extract and store any query arguments.- Parameters:
- path- The new Path value
- contentEncoding- The encoding used for the querystring parameter values
 
- 
getPath
- 
setFollowRedirectspublic void setFollowRedirects(boolean value) 
- 
getFollowRedirectspublic boolean getFollowRedirects()
- 
setAutoRedirectspublic void setAutoRedirects(boolean value) 
- 
getAutoRedirectspublic boolean getAutoRedirects()
- 
setMethod
- 
getMethod
- 
setContentEncodingSets the value of the encoding to be used for the content.- Parameters:
- charsetName- the name of the encoding to be used
 
- 
getContentEncoding- Returns:
- the encoding of the content, i.e. its charset name
 
- 
setUseKeepAlivepublic void setUseKeepAlive(boolean value) 
- 
getUseKeepAlivepublic boolean getUseKeepAlive()
- 
setDoMultipartPostDeprecated.- Parameters:
- value- flag whether multiparts should be used
 
- 
getDoMultipartPostDeprecated.usegetDoMultipart()- Returns:
- flag whether multiparts should be used
 
- 
setDoMultipartpublic void setDoMultipart(boolean value) 
- 
getDoMultipartpublic boolean getDoMultipart()
- 
setDoBrowserCompatibleMultipartpublic void setDoBrowserCompatibleMultipart(boolean value) 
- 
getDoBrowserCompatibleMultipartpublic boolean getDoBrowserCompatibleMultipart()
- 
setMonitor
- 
setMonitorpublic void setMonitor(boolean truth) 
- 
getMonitorDeprecated.since 3.2 always returns false- Returns:
- boolean
 
- 
isMonitorDeprecated.since 3.2 always returns false- Returns:
- boolean
 
- 
setImplementation
- 
getImplementation
- 
useMD5public boolean useMD5()
- 
setMD5public void setMD5(boolean value) 
- 
addEncodedArgumentAdd an argument which has already been encoded- Parameters:
- name- name of the argument
- value- value of the argument
 
- 
addEncodedArgumentCreates an HTTPArgument and adds it to the current setgetArguments()of arguments.- Parameters:
- name- - the parameter name
- value- - the parameter value
- metaData- - normally just '='
- contentEncoding- - the encoding, may be null
 
- 
addEncodedArgument
- 
addNonEncodedArgument
- 
addNonEncodedArgument
- 
addArgument
- 
addArgument
- 
hasArgumentspublic boolean hasArguments()
- 
addTestElementpublic void addTestElement(org.apache.jmeter.testelement.TestElement el) Description copied from class:AbstractTestElement- Specified by:
- addTestElementin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- addTestElementin class- AbstractTestElement
 
- 
clearTestElementChildrenpublic void clearTestElementChildren()Default implementation - does nothing Clears the Header Manager property so subsequent loops don't keep merging more elements - Specified by:
- clearTestElementChildrenin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clearTestElementChildrenin class- AbstractTestElement
 
- 
setPortpublic void setPort(int value) 
- 
getDefaultPortGet the port number for a URL, applying defaults if necessary. (Called by CookieManager.)- Parameters:
- protocol- from- URL.getProtocol()
- port- number from- URL.getPort()
- Returns:
- the default port for the protocol
 
- 
getPortIfSpecifiedpublic int getPortIfSpecified()Get the port number from the port string, allowing for trailing blanks.- Returns:
- port number or UNSPECIFIED_PORT (== 0)
 
- 
isProtocolDefaultPortpublic boolean isProtocolDefaultPort()Tell whether the default port for the specified protocol is used- Returns:
- true if the default port number for the protocol is used, false otherwise
 
- 
getPortpublic int getPort()Get the port; apply the default for the protocol if necessary.- Returns:
- the port number, with default applied if required.
 
- 
setDomain
- 
getDomain
- 
setConnectTimeout
- 
getConnectTimeoutpublic int getConnectTimeout()
- 
setResponseTimeout
- 
getResponseTimeoutpublic int getResponseTimeout()
- 
getProxyScheme
- 
setProxyScheme
- 
getProxyHost
- 
setProxyHost
- 
getProxyPortIntpublic int getProxyPortInt()
- 
setProxyPortInt
- 
getProxyUser
- 
setProxyUser
- 
getProxyPass
- 
setProxyPass
- 
setArguments
- 
getArguments
- 
setPostBodyRawpublic void setPostBodyRaw(boolean value) - Parameters:
- value- Boolean that indicates body will be sent as is
 
- 
getPostBodyRawpublic boolean getPostBodyRaw()- Returns:
- boolean that indicates body will be sent as is
 
- 
setAuthManager
- 
getAuthManager
- 
setHeaderManager
- 
getHeaderManager
- 
setCookieManager
- 
getCookieManager
- 
setKeystoreConfig
- 
getKeystoreConfig
- 
setCacheManager
- 
getCacheManager
- 
getDNSResolver
- 
setDNSResolver
- 
isImageParserpublic boolean isImageParser()
- 
setImageParserpublic void setImageParser(boolean parseImages) 
- 
getEmbeddedUrlREGet the regular expression URLs must match.- Returns:
- regular expression (or empty) string
 
- 
setEmbeddedUrlRE
- 
getEmbededUrlExcludeRE- Returns:
- the regular (as String) expression that embedded URLs must not match
 
- 
setEmbeddedUrlExcludeRE
- 
errorResultPopulates the provided HTTPSampleResult with details from the Exception. Does not create a new instance, so should not be used directly to add a subsample.- Parameters:
- e- Exception representing the error.
- res- SampleResult to be modified
- Returns:
- the modified sampling result containing details of the Exception.
 
- 
getUrlGet the URL, built from its component parts.As a special case, if the path starts with "http[s]://", then the path is assumed to be the entire URL. - Returns:
- The URL to be requested by this sampler.
- Throws:
- MalformedURLException- if url is malformed
 
- 
getQueryStringGets the QueryString attribute of the UrlConfig object, using UTF-8 to encode the URL- Returns:
- the QueryString value
 
- 
getQueryStringGets the QueryString attribute of the UrlConfig object, using the specified encoding to encode the parameter values put into the URL- Parameters:
- contentEncoding- the encoding to use for encoding parameter values
- Returns:
- the QueryString value
 
- 
parseArgumentsThis method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object. For each name found, addArgument() is called- Parameters:
- queryString- - the query string, might be the post body of a http post request.
- contentEncoding- - the content encoding of the query string; if non-null then it is used to decode the
 
- 
parseArguments
- 
toString
- 
sampleDo a sampling and return its results.
- 
samplePerform a sample, and return the results- Returns:
- results of the sampling
 
- 
sampleprotected abstract HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth) Samples the URL passed in and stores the result inHTTPSampleResult, 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. - Parameters:
- u- URL to sample
- method- HTTP method: GET, POST,...
- areFollowingRedirect- whether we're getting a redirect target
- depth- Depth of this target in the frame structure. Used only to prevent infinite recursion.
- Returns:
- results of the sampling, can be null if u is in CacheManager
 
- 
downloadPageResourcesprotected HTTPSampleResult downloadPageResources(HTTPSampleResult pRes, HTTPSampleResult container, int frameDepth) Download the resources of an HTML page.- Parameters:
- pRes- result of the initial request - must contain an HTML response
- container- for storing the results, if any
- frameDepth- Depth of this target in the frame structure. Used only to prevent infinite recursion.
- Returns:
- res if no resources exist, otherwise the "Container" result with one subsample per request issued
 
- 
encodeSpaces
- 
testEndedpublic void testEnded()Called once for all threads after the end of a test. This will use the same element instances as at the start of the test. N.B. testStarted() and testEnded() are called from different threads. - Specified by:
- testEndedin interface- TestStateListener
- See Also:
 
- 
testEndedCalled once for all threads after the end of a test. This will use the same element instances as at the start of the test. N.B. testStarted() and testEnded() are called from different threads. - Specified by:
- testEndedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testStartedpublic void testStarted()Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point. N.B. testStarted() and testEnded() are called from different threads. - Specified by:
- testStartedin interface- TestStateListener
- See Also:
 
- 
testStartedCalled just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point. N.B. testStarted() and testEnded() are called from different threads. - Specified by:
- testStartedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
followRedirectsIteratively download the redirect targets of a redirect response.The returned result will contain one subsample for each request issued, including the original one that was passed in. It will be an HTTPSampleResult that should mostly look as if the final destination of the redirect chain had been obtained in a single shot. - Parameters:
- res- result of the initial request - must be a redirect response
- frameDepth- Depth of this target in the frame structure. Used only to prevent infinite recursion.
- Returns:
- "Container" result with one subsample per request issued
 
- 
resultProcessingprotected HTTPSampleResult resultProcessing(boolean pAreFollowingRedirect, int frameDepth, HTTPSampleResult pRes) Follow redirects and download page resources if appropriate. this works, but the container stuff here is what's doing it. followRedirects() is actually doing the work to make sure we have only one container to make this work more naturally, I think this method - sample() - needs to take an HTTPSamplerResult container parameter instead of a boolean:areFollowingRedirect.- Parameters:
- pAreFollowingRedirect- flag whether we are getting a redirect target
- frameDepth- Depth of this target in the frame structure. Used only to prevent infinite recursion.
- pRes- sample result to process
- Returns:
- the sample result
 
- 
isSuccessCodeprotected boolean isSuccessCode(int code) Determine if the HTTP status code is successful or not i.e. in range 200 to 399 inclusive- Parameters:
- code- status code to check
- Returns:
- whether in range 200-399 or not
 
- 
encodeBackSlashes
- 
getHTTPFilesGet the collection of files as a list. The list is built up from the filename/filefield/mimetype properties, plus any additional entries saved in the FILE_ARGS property. If there are no valid file entries, then an empty list is returned.- Returns:
- an array of file arguments (never null)
 
- 
getHTTPFileCountpublic int getHTTPFileCount()
- 
setHTTPFilesSaves the list of files. The first file is saved in the Filename/field/mimetype properties. Any additional files are saved in the FILE_ARGS array.- Parameters:
- files- list of files to save
 
- 
getValidMethodsAsArray
- 
isSecure
- 
isSecure
- 
threadStartedpublic void threadStarted()Description copied from interface:ThreadListenerCalled for each thread before starting sampling. WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet. See org.apache.jmeter.threads.JMeterThread#threadStarted()- Specified by:
- threadStartedin interface- ThreadListener
 
- 
threadFinishedpublic void threadFinished()Description copied from interface:ThreadListenerCalled for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)- Specified by:
- threadFinishedin interface- ThreadListener
 
- 
testIterationStartDescription copied from interface:TestIterationListenerEach time through a Thread Group's test script, an iteration event is fired for each thread. This will be after the test elements have been cloned, so in general the instance will not be the same as the ones the start/end methods call.- Specified by:
- testIterationStartin interface- TestIterationListener
- Parameters:
- event- the iteration event
 
- 
readResponsepublic byte[] readResponse(SampleResult sampleResult, InputStream in, long length) throws IOException Read response from the input stream, converting to MD5 digest if the useMD5 property is set.For the MD5 case, the result byte count is set to the size of the original response. Closes the inputStream - Parameters:
- sampleResult- sample to store information about the response into
- in- input stream from which to read the response
- length- expected input length or zero
- Returns:
- the response or the MD5 of the response
- Throws:
- IOException- if reading the result fails
 
- 
setIpSourceset IP source to use - does not apply to Java HTTP implementation currently- Parameters:
- value- IP source to use
 
- 
getIpSourceget IP source to use - does not apply to Java HTTP implementation currently- Returns:
- IP source to use
 
- 
setIpSourceTypepublic void setIpSourceType(int value) set IP/address source type to use- Parameters:
- value- type of the IP/address source
 
- 
getIpSourceTypepublic int getIpSourceType()get IP/address source type to use- Returns:
- address source type
 
- 
isConcurrentDwnpublic boolean isConcurrentDwn()Return if used a concurrent thread pool to get embedded resources.- Returns:
- true if used
 
- 
setConcurrentDwnpublic void setConcurrentDwn(boolean concurrentDwn) 
- 
getConcurrentPoolGet the pool size for concurrent thread pool to get embedded resources.- Returns:
- the pool size
 
- 
setConcurrentPool
- 
appliesDescription copied from class:AbstractSamplerDoes configElement apply to Sampler- Specified by:
- appliesin interface- ConfigMergabilityIndicator
- Overrides:
- appliesin class- AbstractSampler
- Parameters:
- configElement-- ConfigTestElement
- Returns:
- boolean
- See Also:
 
- 
replaceReplace by replaceBy in path and body (arguments) properties- Specified by:
- replacein interface- Replaceable
- Parameters:
- regex- Regular expression to search for
- replaceBy- Text used as replacement
- caseSensitive- flag, whether search should be done case sensitive
- Returns:
- number of replacements
- Throws:
- Exception- when something fails while replacing
 
 
- 
getDoMultipart()