Class DefaultSamplerCreator
- java.lang.Object
-
- org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator
-
- org.apache.jmeter.protocol.http.proxy.DefaultSamplerCreator
-
- All Implemented Interfaces:
SamplerCreator
public class DefaultSamplerCreator extends AbstractSamplerCreator
Default implementation that handles classical HTTP textual + Multipart requests
-
-
Field Summary
-
Fields inherited from class org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator
HTTP, HTTPS
-
-
Constructor Summary
Constructors Constructor Description DefaultSamplerCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
computeContentEncoding(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings, String urlWithoutQuery)
Computes content encoding from request and if not found uses pageEncoding and formEncoding to see if URL was previously computed with a content typeprotected void
computeContentEncoding(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
Compute content encodingprotected void
computeDomain(HTTPSamplerBase sampler, HttpRequestHdr request)
Set domain on samplerprotected void
computeFromHeader(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
Compute sampler informations from Request Headerprotected void
computeFromPostBody(HTTPSamplerBase sampler, HttpRequestHdr request)
Compute sampler informations from Request Headerprotected void
computeMethod(HTTPSamplerBase sampler, HttpRequestHdr request)
Set method on samplerprotected void
computePath(HTTPSamplerBase sampler, HttpRequestHdr request)
Set path on samplerprotected void
computePort(HTTPSamplerBase sampler, HttpRequestHdr request)
Set Port on samplerprotected void
computeProtocol(HTTPSamplerBase sampler, HttpRequestHdr request)
Set protocol on samplerprotected void
computeSamplerName(HTTPSamplerBase sampler, HttpRequestHdr request)
Compute sampler nameHTTPSamplerBase
createSampler(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
Create HTTPSamplerBaseString[]
getManagedContentTypes()
void
populateSampler(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
Populate sampler from request-
Methods inherited from class org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator
createAndPopulateSampler, createChildren, getBinaryDirectory, getBinaryFileSuffix, getRequestNumber, incrementRequestNumber, isBinaryContent, isNumberRequests, postProcessSampler
-
-
-
-
Method Detail
-
getManagedContentTypes
public String[] getManagedContentTypes()
- Returns:
- String[] array of Content types managed by Factory
- See Also:
SamplerCreator.getManagedContentTypes()
-
createSampler
public HTTPSamplerBase createSampler(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
Description copied from interface:SamplerCreator
Create HTTPSamplerBase- Parameters:
request
-HttpRequestHdr
pageEncodings
- Map of page encodingsformEncodings
- Map of form encodings- Returns:
HTTPSamplerBase
- See Also:
SamplerCreator.createSampler(org.apache.jmeter.protocol.http.proxy.HttpRequestHdr, java.util.Map, java.util.Map)
-
populateSampler
public final void populateSampler(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws Exception
Description copied from interface:SamplerCreator
Populate sampler from request- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
pageEncodings
- Map of page encodingsformEncodings
- Map of form encodings- Throws:
Exception
- when something fails- See Also:
SamplerCreator.populateSampler(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase, org.apache.jmeter.protocol.http.proxy.HttpRequestHdr, java.util.Map, java.util.Map)
-
computeFromHeader
protected void computeFromHeader(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws Exception
Compute sampler informations from Request Header- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
pageEncodings
- Map of page encodingsformEncodings
- Map of form encodings- Throws:
Exception
- when something fails
-
computeFromPostBody
protected void computeFromPostBody(HTTPSamplerBase sampler, HttpRequestHdr request) throws Exception
Compute sampler informations from Request Header- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
- Throws:
Exception
- when something fails
-
computeSamplerName
protected void computeSamplerName(HTTPSamplerBase sampler, HttpRequestHdr request)
Compute sampler name- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
-
computePath
protected void computePath(HTTPSamplerBase sampler, HttpRequestHdr request)
Set path on sampler- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
-
computeContentEncoding
protected void computeContentEncoding(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws MalformedURLException
Compute content encoding- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
pageEncodings
- Map of page encodingsformEncodings
- Map of form encodings- Throws:
MalformedURLException
- when noURL
could be built fromsampler
andrequest
-
computeContentEncoding
protected String computeContentEncoding(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings, String urlWithoutQuery)
Computes content encoding from request and if not found uses pageEncoding and formEncoding to see if URL was previously computed with a content type- Parameters:
request
-HttpRequestHdr
pageEncodings
- Map of page encodingsformEncodings
- Map of form encodingsurlWithoutQuery
- the request URL without the query parameters- Returns:
- String content encoding
-
computeProtocol
protected void computeProtocol(HTTPSamplerBase sampler, HttpRequestHdr request)
Set protocol on sampler- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
-
computePort
protected void computePort(HTTPSamplerBase sampler, HttpRequestHdr request)
Set Port on sampler- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
-
computeMethod
protected void computeMethod(HTTPSamplerBase sampler, HttpRequestHdr request)
Set method on sampler- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
-
computeDomain
protected void computeDomain(HTTPSamplerBase sampler, HttpRequestHdr request)
Set domain on sampler- Parameters:
sampler
-HTTPSamplerBase
request
-HttpRequestHdr
-
-