Class ProxyControl
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Cloneable
,org.apache.jmeter.control.Controller
,org.apache.jmeter.gui.Searchable
,org.apache.jmeter.testelement.NonTestElement
,org.apache.jmeter.testelement.TestElement
,org.apache.jmeter.threads.TestCompilerHelper
public class ProxyControl extends GenericController implements NonTestElement
Class handles storing of generated samples etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
ProxyControl.KeystoreMode
-
Field Summary
Fields Modifier and Type Field Description public final static int
DEFAULT_PORT
public final static String
DEFAULT_PORT_S
public final static int
CERT_VALIDITY
public volatile int
groupingMode
public volatile boolean
samplerRedirectAutomatically
public volatile boolean
samplerFollowRedirects
public volatile boolean
samplerDownloadImages
public volatile boolean
regexMatch
public JMeterTreeNode
target
public JMeterTreeModel
nonGuiTreeModel
public transient JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
Constructor Summary
Constructors Constructor Description ProxyControl()
-
Method Summary
Modifier and Type Method Description int
getGroupingMode()
void
setGroupingMode(int grouping)
boolean
getSamplerRedirectAutomatically()
void
setSamplerRedirectAutomatically(boolean b)
boolean
getSamplerFollowRedirects()
void
setSamplerFollowRedirects(boolean b)
boolean
getSamplerDownloadImages()
void
setSamplerDownloadImages(boolean b)
boolean
getRegexMatch()
void
setRegexMatch(boolean b)
JMeterTreeNode
getTarget()
void
setTarget(JMeterTreeNode target)
Sets the target node where samples generated by the proxy are to be stored. JMeterTreeModel
getNonGuiTreeModel()
void
setNonGuiTreeModel(JMeterTreeModel treeModel)
Set a JMeterTreeModel to be used by the ProxyControl, when used in a non-GUI environment, where the JMeterTreeModel can't be acquired through getTreeModel void
setPort(int port)
void
setPort(String port)
void
setSslDomains(String domains)
String
getSslDomains()
void
setCaptureHttpHeaders(boolean capture)
void
setAssertions(boolean b)
void
setSamplerTypeName(String samplerTypeName)
void
setDetectGraphQLRequest(boolean b)
void
setHTTPSampleNamingMode(int httpNamingMode)
String
getDefaultEncoding()
void
setDefaultEncoding(String defaultEncoding)
void
setPrefixHTTPSampleName(String prefixHTTPSampleName)
void
setProxyPauseHTTPSample(String proxyPauseHTTPSample)
void
setNotifyChildSamplerListenerOfFilteredSamplers(boolean b)
void
setIncludeList(Collection<String> list)
void
setExcludeList(Collection<String> list)
void
setContentTypeExclude(String contentTypeExclude)
void
setContentTypeInclude(String contentTypeInclude)
boolean
getAssertions()
int
getPort()
String
getPortString()
int
getDefaultPort()
boolean
getCaptureHttpHeaders()
String
getSamplerTypeName()
boolean
getUseKeepalive()
boolean
getDetectGraphQLRequest()
int
getHTTPSampleNamingMode()
String
getPrefixHTTPSampleName()
String
getProxyPauseHTTPSample()
boolean
getNotifyChildSamplerListenerOfFilteredSamplers()
String
getContentTypeExclude()
String
getContentTypeInclude()
void
setHttpSampleNameFormat(String text)
String
getHttpSampleNameFormat()
void
addConfigElement(ConfigElement config)
void
startProxy()
void
addExcludedPattern(String pattern)
CollectionProperty
getExcludePatterns()
void
addIncludedPattern(String pattern)
CollectionProperty
getIncludePatterns()
void
clearExcludedPatterns()
void
clearIncludedPatterns()
synchronized void
deliverSampler(HTTPSamplerBase sampler, Array<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. void
stopProxy()
Array<String>
getCertificateDetails()
JMeterTreeNode
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.
boolean
canRemove()
static boolean
isDynamicMode()
void
setUseKeepAlive(boolean b)
-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Methods inherited from class org.apache.jmeter.control.GenericController
addIterationListener, addTestElement, addTestElementOnce, getProps, getSchema, initialize, isDone, next, removeIterationListener, setFirst, triggerEndOfLoop
-
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getGroupingMode
int getGroupingMode()
-
setGroupingMode
void setGroupingMode(int grouping)
-
getSamplerRedirectAutomatically
boolean getSamplerRedirectAutomatically()
-
setSamplerRedirectAutomatically
void setSamplerRedirectAutomatically(boolean b)
-
getSamplerFollowRedirects
boolean getSamplerFollowRedirects()
-
setSamplerFollowRedirects
void setSamplerFollowRedirects(boolean b)
-
getSamplerDownloadImages
boolean getSamplerDownloadImages()
-
setSamplerDownloadImages
void setSamplerDownloadImages(boolean b)
-
getRegexMatch
boolean getRegexMatch()
-
setRegexMatch
void setRegexMatch(boolean b)
-
getTarget
JMeterTreeNode getTarget()
-
setTarget
void setTarget(JMeterTreeNode target)
Sets the target node where samples generated by the proxy are to be stored.
- Parameters:
target
- target node to store generated samples
-
getNonGuiTreeModel
JMeterTreeModel getNonGuiTreeModel()
-
setNonGuiTreeModel
void setNonGuiTreeModel(JMeterTreeModel treeModel)
Set a JMeterTreeModel to be used by the ProxyControl, when used in a non-GUI environment, where the JMeterTreeModel can't be acquired through getTreeModel
- Parameters:
treeModel
- the JMeterTreeModel to be used, ornull
when the GUI model should be used
-
setPort
void setPort(int port)
-
setSslDomains
void setSslDomains(String domains)
-
getSslDomains
String getSslDomains()
-
setCaptureHttpHeaders
void setCaptureHttpHeaders(boolean capture)
-
setAssertions
void setAssertions(boolean b)
-
setSamplerTypeName
void setSamplerTypeName(String samplerTypeName)
-
setDetectGraphQLRequest
void setDetectGraphQLRequest(boolean b)
-
setHTTPSampleNamingMode
void setHTTPSampleNamingMode(int httpNamingMode)
-
getDefaultEncoding
String getDefaultEncoding()
-
setDefaultEncoding
void setDefaultEncoding(String defaultEncoding)
-
setPrefixHTTPSampleName
void setPrefixHTTPSampleName(String prefixHTTPSampleName)
-
setProxyPauseHTTPSample
void setProxyPauseHTTPSample(String proxyPauseHTTPSample)
-
setNotifyChildSamplerListenerOfFilteredSamplers
void setNotifyChildSamplerListenerOfFilteredSamplers(boolean b)
-
setIncludeList
void setIncludeList(Collection<String> list)
-
setExcludeList
void setExcludeList(Collection<String> list)
-
setContentTypeExclude
void setContentTypeExclude(String contentTypeExclude)
-
setContentTypeInclude
void setContentTypeInclude(String contentTypeInclude)
-
getAssertions
boolean getAssertions()
-
getPort
int getPort()
-
getPortString
String getPortString()
-
getDefaultPort
int getDefaultPort()
-
getCaptureHttpHeaders
boolean getCaptureHttpHeaders()
-
getSamplerTypeName
String getSamplerTypeName()
-
getUseKeepalive
boolean getUseKeepalive()
-
getDetectGraphQLRequest
boolean getDetectGraphQLRequest()
-
getHTTPSampleNamingMode
int getHTTPSampleNamingMode()
-
getPrefixHTTPSampleName
String getPrefixHTTPSampleName()
-
getProxyPauseHTTPSample
String getProxyPauseHTTPSample()
-
getNotifyChildSamplerListenerOfFilteredSamplers
boolean getNotifyChildSamplerListenerOfFilteredSamplers()
-
getContentTypeExclude
String getContentTypeExclude()
-
getContentTypeInclude
String getContentTypeInclude()
-
setHttpSampleNameFormat
void setHttpSampleNameFormat(String text)
-
getHttpSampleNameFormat
String getHttpSampleNameFormat()
-
addConfigElement
void addConfigElement(ConfigElement config)
-
startProxy
void startProxy()
-
addExcludedPattern
void addExcludedPattern(String pattern)
-
getExcludePatterns
CollectionProperty getExcludePatterns()
-
addIncludedPattern
void addIncludedPattern(String pattern)
-
getIncludePatterns
CollectionProperty getIncludePatterns()
-
clearExcludedPatterns
void clearExcludedPatterns()
-
clearIncludedPatterns
void clearIncludedPatterns()
-
deliverSampler
synchronized void deliverSampler(HTTPSamplerBase sampler, Array<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.result
- the sample result, not null TODO param serverResponse to be added to allow saving of the server's response while recording.
-
stopProxy
void stopProxy()
-
getCertificateDetails
Array<String> getCertificateDetails()
-
findTargetControllerNode
JMeterTreeNode 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.
- The controller specified by the
-
canRemove
boolean canRemove()
-
isDynamicMode
static boolean isDynamicMode()
-
setUseKeepAlive
void setUseKeepAlive(boolean b)
-
-
- The controller specified by the
-