Class ProxyControl
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.control.GenericController
org.apache.jmeter.protocol.http.proxy.ProxyControl
- All Implemented Interfaces:
Serializable
,Cloneable
,Controller
,Searchable
,NonTestElement
,org.apache.jmeter.testelement.TestElement
,TestCompilerHelper
Class handles storing of generated samples etc.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Fields inherited from class org.apache.jmeter.control.GenericController
current, subControllersAndSamplers
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigElement
(ConfigElement config) void
addExcludedPattern
(String pattern) void
addIncludedPattern
(String pattern) boolean
void
void
void
deliverSampler
(HTTPSamplerBase sampler, org.apache.jmeter.testelement.TestElement[] testElements, SampleResult result) Receives the recorded sampler from the proxy server for placing in the test tree; this is skipped if the sampler is null (e.g.Finds the controller where samplers have to be stored, that is: The controller specified by thetarget
property.boolean
boolean
String[]
int
boolean
int
int
boolean
int
getPort()
boolean
boolean
boolean
boolean
boolean
static boolean
void
setAssertions
(boolean b) void
setCaptureHttpHeaders
(boolean capture) void
setContentTypeExclude
(String contentTypeExclude) void
setContentTypeInclude
(String contentTypeInclude) void
setDefaultEncoding
(String defaultEncoding) void
setDetectGraphQLRequest
(boolean b) void
setExcludeList
(Collection<String> list) void
setGroupingMode
(int grouping) void
void
setHTTPSampleNamingMode
(int httpNamingMode) void
setIncludeList
(Collection<String> list) void
setNonGuiTreeModel
(JMeterTreeModel treeModel) Set aJMeterTreeModel
to be used by the ProxyControl, when used in a non-GUI environment, where theJMeterTreeModel
can't be acquired throughGuiPackage.getTreeModel()
void
void
setPort
(int port) void
void
setPrefixHTTPSampleName
(String prefixHTTPSampleName) void
setProxyPauseHTTPSample
(String proxyPauseHTTPSample) void
setRegexMatch
(boolean b) void
setSamplerDownloadImages
(boolean b) void
setSamplerFollowRedirects
(boolean b) void
setSamplerRedirectAutomatically
(boolean b) void
setSamplerTypeName
(String samplerTypeName) void
setSslDomains
(String domains) void
setTarget
(JMeterTreeNode target) Sets the target node where samples generated by the proxy are to be stored.void
setUseKeepAlive
(boolean b) void
void
Methods inherited from class org.apache.jmeter.control.GenericController
addIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getProps, getSchema, getSubControllers, incrementCurrent, incrementIterCount, initialize, initializeSubControllers, isDone, isFirst, next, nextIsAController, nextIsASampler, nextIsNull, readResolve, reInitialize, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst, triggerEndOfLoop
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, clear, clearTemporary, clearTestElementChildren, 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, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
clear, clearTestElementChildren, 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
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_PORT_S
-
CERT_VALIDITY
public static final int CERT_VALIDITY
-
-
Constructor Details
-
ProxyControl
public ProxyControl()
-
-
Method Details
-
setNonGuiTreeModel
Set aJMeterTreeModel
to be used by the ProxyControl, when used in a non-GUI environment, where theJMeterTreeModel
can't be acquired throughGuiPackage.getTreeModel()
- Parameters:
treeModel
- theJMeterTreeModel
to be used, ornull
when the GUI model should be used
-
setPort
public void setPort(int port) -
setPort
-
setSslDomains
-
getSslDomains
-
setCaptureHttpHeaders
public void setCaptureHttpHeaders(boolean capture) -
setGroupingMode
public void setGroupingMode(int grouping) -
setAssertions
public void setAssertions(boolean b) -
setSamplerTypeName
-
setSamplerRedirectAutomatically
public void setSamplerRedirectAutomatically(boolean b) -
setSamplerFollowRedirects
public void setSamplerFollowRedirects(boolean b) -
setUseKeepAlive
public void setUseKeepAlive(boolean b) -
setDetectGraphQLRequest
public void setDetectGraphQLRequest(boolean b) -
setSamplerDownloadImages
public void setSamplerDownloadImages(boolean b) -
setHTTPSampleNamingMode
public void setHTTPSampleNamingMode(int httpNamingMode) -
getDefaultEncoding
-
setDefaultEncoding
-
setPrefixHTTPSampleName
-
setProxyPauseHTTPSample
-
setNotifyChildSamplerListenerOfFilteredSamplers
public void setNotifyChildSamplerListenerOfFilteredSamplers(boolean b) -
setIncludeList
-
setExcludeList
-
setRegexMatch
public void setRegexMatch(boolean b) -
setContentTypeExclude
-
setContentTypeInclude
-
getAssertions
public boolean getAssertions() -
getGroupingMode
public int getGroupingMode() -
getPort
public int getPort() -
getPortString
-
getDefaultPort
public int getDefaultPort() -
getCaptureHttpHeaders
public boolean getCaptureHttpHeaders() -
getSamplerTypeName
-
getSamplerRedirectAutomatically
public boolean getSamplerRedirectAutomatically() -
getSamplerFollowRedirects
public boolean getSamplerFollowRedirects() -
getUseKeepalive
public boolean getUseKeepalive() -
getDetectGraphQLRequest
public boolean getDetectGraphQLRequest() -
getSamplerDownloadImages
public boolean getSamplerDownloadImages() -
getHTTPSampleNamingMode
public int getHTTPSampleNamingMode() -
getPrefixHTTPSampleName
-
getProxyPauseHTTPSample
-
getNotifyChildSamplerListenerOfFilteredSamplers
public boolean getNotifyChildSamplerListenerOfFilteredSamplers() -
getRegexMatch
public boolean getRegexMatch() -
getContentTypeExclude
-
getContentTypeInclude
-
setHttpSampleNameFormat
-
getHttpSampleNameFormat
-
getNonGuiTreeModel
- Returns:
- the
JMeterTreeModel
used when run in non-GUI mode, ornull
when run in GUI mode
-
addConfigElement
-
startProxy
- Throws:
IOException
-
addExcludedPattern
-
getExcludePatterns
-
addIncludedPattern
-
getIncludePatterns
-
clearExcludedPatterns
public void clearExcludedPatterns() -
clearIncludedPatterns
public void clearIncludedPatterns() -
getTarget
- Returns:
- the target controller node
-
setTarget
Sets the target node where samples generated by the proxy are to be stored.- Parameters:
target
- target node to store generated samples
-
deliverSampler
public void deliverSampler(HTTPSamplerBase sampler, org.apache.jmeter.testelement.TestElement[] testElements, SampleResult result) Receives the recorded sampler from the proxy server for placing in the test tree; this is skipped if the sampler is null (e.g. for recording SSL errors) Always sends the result to any registered sample listeners.- Parameters:
sampler
- the sampler, may be nulltestElements
- the test elements to be added (e.g. header manager) under the Samplerresult
- the sample result, not null TODO param serverResponse to be added to allow saving of the server's response while recording.
-
stopProxy
public void stopProxy() -
getCertificateDetails
-
findTargetControllerNode
Finds the controller where samplers have to be stored, that is:- The controller specified by the
target
property. - If none was specified, the first RecordingController in the tree.
- If none is found, the first AbstractThreadGroup in the tree.
- Returns:
- the tree node for the controller where the proxy must store the generated samplers.
- The controller specified by the
-
canRemove
public boolean canRemove()Description copied from class:AbstractTestElement
- Specified by:
canRemove
in interfaceorg.apache.jmeter.testelement.TestElement
- Overrides:
canRemove
in classAbstractTestElement
-
isDynamicMode
public static boolean isDynamicMode()
-