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, TestElement, TestCompilerHelper
Class handles storing of generated samples, etc
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class GenericController
current, subControllersAndSamplersFields inherited from interface TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigElement(ConfigElement config) voidaddExcludedPattern(String pattern) voidaddIncludedPattern(String pattern) booleanCalled by Remove to determine if it is safe to remove the element.voidvoidvoiddeliverSampler(HTTPSamplerBase sampler, TestElement[] subConfigs, 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.Finds the controller where samplers have to be stored, that is: The controller specified by thetargetproperty.booleanbooleanString[]intintbooleanintgetPort()booleanbooleanbooleanbooleanbooleanstatic booleanvoidsetAssertions(boolean b) voidsetCaptureHttpHeaders(boolean capture) voidsetContentTypeExclude(String contentTypeExclude) voidsetContentTypeInclude(String contentTypeInclude) voidsetExcludeList(Collection<String> list) voidsetGroupingMode(int grouping) voidsetIncludeList(Collection<String> list) voidvoidsetPort(int port) voidvoidsetRegexMatch(boolean b) voidsetSamplerDownloadImages(boolean b) voidsetSamplerFollowRedirects(boolean b) voidsetSamplerRedirectAutomatically(boolean b) voidsetSamplerTypeName(int samplerTypeName) Deprecated.voidsetSamplerTypeName(String samplerTypeName) voidsetSslDomains(String domains) voidsetTarget(JMeterTreeNode target) Sets the target node where the samples generated by the proxy have to be stored.voidsetUseKeepAlive(boolean b) voidvoidMethods inherited from class GenericController
addIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getSubControllers, incrementCurrent, incrementIterCount, initialize, initializeSubControllers, isDone, isFirst, next, nextIsAController, nextIsASampler, nextIsNull, readResolve, reInitialize, reInitializeSubController, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst, triggerEndOfLoopMethods inherited from class AbstractTestElement
addPropertiesValues, addProperty, addProperty, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, 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 Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TestElement
clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, 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
-
-
Constructor Details
-
ProxyControl
public ProxyControl()
-
-
Method Details
-
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
Deprecated. -
setSamplerTypeName
-
setSamplerRedirectAutomatically
public void setSamplerRedirectAutomatically(boolean b) -
setSamplerFollowRedirects
public void setSamplerFollowRedirects(boolean b) -
setUseKeepAlive
public void setUseKeepAlive(boolean b) - Parameters:
b- flag whether keep alive should be used
-
setSamplerDownloadImages
public void setSamplerDownloadImages(boolean b) -
setNotifyChildSamplerListenerOfFilteredSamplers
public void setNotifyChildSamplerListenerOfFilteredSamplers(boolean b) -
setIncludeList
-
setExcludeList
-
setRegexMatch
public void setRegexMatch(boolean b) - Parameters:
b- flag whether regex matching should be used
-
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() -
getSamplerDownloadImages
public boolean getSamplerDownloadImages() -
getNotifyChildSamplerListenerOfFilteredSamplers
public boolean getNotifyChildSamplerListenerOfFilteredSamplers() -
getRegexMatch
public boolean getRegexMatch() -
getContentTypeExclude
-
getContentTypeInclude
-
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 the samples generated by the proxy have to be stored.- Parameters:
target- target node to store generated samples
-
deliverSampler
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 nullsubConfigs- the configuration elements to be added (e.g. header namager)result- 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
targetproperty. - If none was specified, the first RecordingController in the tree.
- If none is found, the first AbstractThreadGroup in the tree.
- If none is found, the Workspace.
- 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:AbstractTestElementCalled by Remove to determine if it is safe to remove the element. The element can either clean itself up, and return true, or the element can return false.- Specified by:
canRemovein interfaceTestElement- Overrides:
canRemovein classAbstractTestElement- Returns:
- true if safe to remove the element
-
isDynamicMode
public static boolean isDynamicMode()
-