Class ProxyControl

All Implemented Interfaces:
Serializable, Cloneable, Controller, Searchable, NonTestElement, org.apache.jmeter.testelement.TestElement, TestCompilerHelper

public class ProxyControl extends GenericController implements NonTestElement
Class handles storing of generated samples etc.
See Also:
  • Field Details


      public static final int DEFAULT_PORT
      See Also:

      public static final String DEFAULT_PORT_S

      public static final int CERT_VALIDITY
  • Constructor Details

    • ProxyControl

      public ProxyControl()
  • Method Details

    • setNonGuiTreeModel

      public 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 GuiPackage.getTreeModel()
      treeModel - the JMeterTreeModel to be used, or null when the GUI model should be used
    • setPort

      public void setPort(int port)
    • setPort

      public void setPort(String port)
    • setSslDomains

      public void setSslDomains(String domains)
    • getSslDomains

      public String getSslDomains()
    • setCaptureHttpHeaders

      public void setCaptureHttpHeaders(boolean capture)
    • setGroupingMode

      public void setGroupingMode(int grouping)
    • setAssertions

      public void setAssertions(boolean b)
    • setSamplerTypeName

      public void setSamplerTypeName(String samplerTypeName)
    • 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

      public String getDefaultEncoding()
    • setDefaultEncoding

      public void setDefaultEncoding(String defaultEncoding)
    • setPrefixHTTPSampleName

      public void setPrefixHTTPSampleName(String prefixHTTPSampleName)
    • setProxyPauseHTTPSample

      public void setProxyPauseHTTPSample(String proxyPauseHTTPSample)
    • setNotifyChildSamplerListenerOfFilteredSamplers

      public void setNotifyChildSamplerListenerOfFilteredSamplers(boolean b)
    • setIncludeList

      public void setIncludeList(Collection<String> list)
    • setExcludeList

      public void setExcludeList(Collection<String> list)
    • setRegexMatch

      public void setRegexMatch(boolean b)
    • setContentTypeExclude

      public void setContentTypeExclude(String contentTypeExclude)
    • setContentTypeInclude

      public void setContentTypeInclude(String contentTypeInclude)
    • getAssertions

      public boolean getAssertions()
    • getGroupingMode

      public int getGroupingMode()
    • getPort

      public int getPort()
    • getPortString

      public String getPortString()
    • getDefaultPort

      public int getDefaultPort()
    • getCaptureHttpHeaders

      public boolean getCaptureHttpHeaders()
    • getSamplerTypeName

      public String 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

      public String getPrefixHTTPSampleName()
    • getProxyPauseHTTPSample

      public String getProxyPauseHTTPSample()
    • getNotifyChildSamplerListenerOfFilteredSamplers

      public boolean getNotifyChildSamplerListenerOfFilteredSamplers()
    • getRegexMatch

      public boolean getRegexMatch()
    • getContentTypeExclude

      public String getContentTypeExclude()
    • getContentTypeInclude

      public String getContentTypeInclude()
    • setHttpSampleNameFormat

      public void setHttpSampleNameFormat(String text)
    • getHttpSampleNameFormat

      public String getHttpSampleNameFormat()
    • getNonGuiTreeModel

      public JMeterTreeModel getNonGuiTreeModel()
      the JMeterTreeModel used when run in non-GUI mode, or null when run in GUI mode
    • addConfigElement

      public void addConfigElement(ConfigElement config)
    • startProxy

      public void startProxy() throws IOException
    • addExcludedPattern

      public void addExcludedPattern(String pattern)
    • getExcludePatterns

      public CollectionProperty getExcludePatterns()
    • addIncludedPattern

      public void addIncludedPattern(String pattern)
    • getIncludePatterns

      public CollectionProperty getIncludePatterns()
    • clearExcludedPatterns

      public void clearExcludedPatterns()
    • clearIncludedPatterns

      public void clearIncludedPatterns()
    • getTarget

      public JMeterTreeNode getTarget()
      the target controller node
    • setTarget

      public void setTarget(JMeterTreeNode target)
      Sets the target node where samples generated by the proxy are to be stored.
      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.
      sampler - the sampler, may be null
      testElements - the test elements to be added (e.g. header manager) under the Sampler
      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

      public String[] getCertificateDetails()
    • findTargetControllerNode

      public 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 tree node for the controller where the proxy must store the generated samplers.
    • canRemove

      public boolean canRemove()
      Description copied from class: AbstractTestElement
      Specified by:
      canRemove in interface org.apache.jmeter.testelement.TestElement
      canRemove in class AbstractTestElement
    • isDynamicMode

      public static boolean isDynamicMode()