jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ago...@apache.org
Subject svn commit: r1807583 - in /jmeter/trunk: src/core/org/apache/jmeter/resources/ src/protocol/http/org/apache/jmeter/protocol/http/proxy/ src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ xdocs/ xdocs/images/screenshots/
Date Thu, 07 Sep 2017 10:33:30 GMT
Author: agomes
Date: Thu Sep  7 10:33:30 2017
New Revision: 1807583

URL: http://svn.apache.org/viewvc?rev=1807583&view=rev
Log:
This closes #61492 : Add the possibility to change the value of proxy.pause in the HTTP(S)
Test Script Recorder GUI

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/images/screenshots/proxy_control.png

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1807583&r1=1807582&r2=1807583&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Thu Sep  7 10:33:30
2017
@@ -777,11 +777,14 @@ proxy_domains_dynamic_mode_tooltip_java6
 proxy_general_lifecycle=State
 proxy_general_settings=Global Settings
 proxy_headers=Capture HTTP Headers
+proxy_pause_http_sampler=Create new transaction after request (ms)\:
 proxy_prefix_http_sampler_name=Prefix\:
 proxy_regex=Regex matching
 proxy_sampler_settings=HTTP Sampler settings
 proxy_sampler_type=Type\:
 proxy_separators=Add Separators
+proxy_settings_pause_error_digits=Only digits allowed
+proxy_settings_pause_error_invalid_data=Invalid data
 proxy_settings_port_error_digits=Only digits allowed
 proxy_settings_port_error_invalid_data=Invalid data
 proxy_target=Target Controller\:

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1807583&r1=1807582&r2=1807583&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Thu Sep  7 10:33:30
2017
@@ -767,11 +767,14 @@ proxy_domains_dynamic_mode_tooltip_java6
 proxy_general_lifecycle=Etat
 proxy_general_settings=Param\u00E8tres g\u00E9n\u00E9raux
 proxy_headers=Capturer les ent\u00EAtes HTTP
+proxy_pause_http_sampler=Cr\u00E9er une nouvelle transaction apr\u00E8s la requ\u00EAte (ms)
\:
 proxy_prefix_http_sampler_name=Pr\u00E9fixe \:
 proxy_regex=Correspondance des variables par regex ?
 proxy_sampler_settings=Param\u00E8tres Echantillon HTTP
 proxy_sampler_type=Type \:
 proxy_separators=Ajouter des s\u00E9parateurs
+proxy_settings_pause_error_digits=Seuls les chiffres sont autoris\u00E9s.
+proxy_settings_pause_error_invalid_data=Donn\u00E9es invalides
 proxy_settings_port_error_digits=Seuls les chiffres sont autoris\u00E9s.
 proxy_settings_port_error_invalid_data=Donn\u00E9es invalides
 proxy_target=Contr\u00F4leur Cible \:

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?rev=1807583&r1=1807582&r2=1807583&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Thu Sep  7 10:33:30 2017
@@ -158,6 +158,8 @@ public class ProxyControl extends Generi
     private static final String SAMPLER_DOWNLOAD_IMAGES = "ProxyControlGui.sampler_download_images";
// $NON-NLS-1$
     
     private static final String PREFIX_HTTP_SAMPLER_NAME = "ProxyControlGui.proxy_prefix_http_sampler_name";
// $NON-NLS-1$
+    
+    private static final String PROXY_PAUSE_HTTP_SAMPLER = "ProxyControlGui.proxy_pause_http_sampler";
// $NON-NLS-1$
 
     private static final String REGEX_MATCH = "ProxyControlGui.regex_match"; // $NON-NLS-1$
 
@@ -185,8 +187,7 @@ public class ProxyControl extends Generi
     private static final String SAMPLER_TYPE_HTTP_SAMPLER_HC3_1 = "1";
     private static final String SAMPLER_TYPE_HTTP_SAMPLER_HC4 = "2";
 
-    private static final long SAMPLE_GAP =
-        JMeterUtils.getPropDefault("proxy.pause", 5000); // $NON-NLS-1$
+    private long sampleGap; // $NON-NLS-1$
     // Detect if user has pressed a new link
 
     // for ssl connection
@@ -392,6 +393,10 @@ public class ProxyControl extends Generi
     public void setPrefixHTTPSampleName(String prefixHTTPSampleName) {
         setProperty(PREFIX_HTTP_SAMPLER_NAME, prefixHTTPSampleName);
     }
+    
+    public void setProxyPauseHTTPSample(String proxyPauseHTTPSample) {
+    setProperty(PROXY_PAUSE_HTTP_SAMPLER, proxyPauseHTTPSample);
+    }
 
     public void setNotifyChildSamplerListenerOfFilteredSamplers(boolean b) {
         notifyChildSamplerListenersOfFilteredSamples = b;
@@ -478,6 +483,10 @@ public class ProxyControl extends Generi
     public String getPrefixHTTPSampleName() {
         return getPropertyAsString(PREFIX_HTTP_SAMPLER_NAME);
     }
+    
+    public String getProxyPauseHTTPSample() {
+        return getPropertyAsString(PROXY_PAUSE_HTTP_SAMPLER);
+        }
 
     public boolean getNotifyChildSamplerListenerOfFilteredSamplers() {
         return getPropertyAsBoolean(NOTIFY_CHILD_SAMPLER_LISTENERS_FILTERED, true);
@@ -519,6 +528,11 @@ public class ProxyControl extends Generi
         notifyTestListenersOfStart();
         try {
             server = new Daemon(getPort(), this);
+            if (getProxyPauseHTTPSample().isEmpty()) {
+                sampleGap = JMeterUtils.getPropDefault("proxy.pause", 5000);
+                } else {
+                    sampleGap = Long.parseLong(getProxyPauseHTTPSample().trim());
+                }
             server.start();
             if (GuiPackage.getInstance() != null) {
                 GuiPackage.getInstance().register(server);
@@ -1152,7 +1166,7 @@ public class ProxyControl extends Generi
             long now = System.currentTimeMillis();
             long deltaT = now - lastTime;
             int cachedGroupingMode = groupingMode;
-            if (deltaT > SAMPLE_GAP) {
+            if (deltaT > sampleGap) {
                 if (!myTarget.isLeaf() && cachedGroupingMode == GROUPING_ADD_SEPARATORS)
{
                     addDivider(treeModel, myTarget);
                 }

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=1807583&r1=1807582&r2=1807583&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Thu Sep  7 10:33:30 2017
@@ -160,6 +160,11 @@ public class ProxyControlGui extends Log
      * Add a prefix to HTTP sample name recorded
      */
     private JTextField prefixHTTPSampleName;
+    
+    /*
+     * Delay between HTTP requests
+     */
+    private JTextField proxyPauseHTTPSample;
 
     /**
      * Regular expression to include results based on content type
@@ -224,6 +229,8 @@ public class ProxyControlGui extends Log
     private static final String ADD_SUGGESTED_EXCLUDES = "exclude_suggested";
 
     private static final String PREFIX_HTTP_SAMPLER_NAME = "proxy_prefix_http_sampler_name";
// $NON-NLS-1$
+    
+    private static final String PROXY_PAUSE_HTTP_SAMPLER = "proxy_pause_http_sampler"; //
$NON-NLS-1$
     //- action names
 
     // Resource names for column headers
@@ -279,6 +286,7 @@ public class ProxyControlGui extends Log
             model.setUseKeepAlive(useKeepAlive.isSelected());
             model.setSamplerDownloadImages(samplerDownloadImages.isSelected());
             model.setPrefixHTTPSampleName(prefixHTTPSampleName.getText());
+            model.setProxyPauseHTTPSample(proxyPauseHTTPSample.getText());
             model.setNotifyChildSamplerListenerOfFilteredSamplers(notifyChildSamplerListenerOfFilteredSamplersCB.isSelected());
             model.setRegexMatch(regexMatch.isSelected());
             model.setContentTypeInclude(contentTypeInclude.getText());
@@ -340,6 +348,7 @@ public class ProxyControlGui extends Log
         useKeepAlive.setSelected(model.getUseKeepalive());
         samplerDownloadImages.setSelected(model.getSamplerDownloadImages());
         prefixHTTPSampleName.setText(model.getPrefixHTTPSampleName());
+        proxyPauseHTTPSample.setText(model.getProxyPauseHTTPSample());
         notifyChildSamplerListenerOfFilteredSamplersCB.setSelected(model.getNotifyChildSamplerListenerOfFilteredSamplers());
         regexMatch.setSelected(model.getRegexMatch());
         contentTypeInclude.setText(model.getContentTypeInclude());
@@ -631,6 +640,22 @@ public class ProxyControlGui extends Log
             enableRestart();
         } else if(fieldName.equals(PREFIX_HTTP_SAMPLER_NAME)) {
             model.setPrefixHTTPSampleName(prefixHTTPSampleName.getText());
+        } else if(fieldName.equals(PROXY_PAUSE_HTTP_SAMPLER)) {
+            try {
+                Long.parseLong(proxyPauseHTTPSample.getText());
+                } catch (NumberFormatException nfe) {
+                    int length = proxyPauseHTTPSample.getText().length();
+                    if (length > 0) {
+                        JOptionPane.showMessageDialog(this, 
+                                JMeterUtils.getResString("proxy_settings_pause_error_digits"),
// $NON-NLS-1$
+                                JMeterUtils.getResString("proxy_settings_pause_error_invalid_data"),
// $NON-NLS-1$
+                                JOptionPane.WARNING_MESSAGE);
+                        // Drop the last character:
+                        proxyPauseHTTPSample.setText(proxyPauseHTTPSample.getText().substring(0,
length-1));
+                        }
+                    }
+            model.setProxyPauseHTTPSample(proxyPauseHTTPSample.getText());
+            enableRestart();
         }
     }
 
@@ -821,6 +846,13 @@ public class ProxyControlGui extends Log
         JLabel labelPrefix = new JLabel(JMeterUtils.getResString("proxy_prefix_http_sampler_name"));
// $NON-NLS-1$
         labelPrefix.setLabelFor(prefixHTTPSampleName);
 
+        proxyPauseHTTPSample = new JTextField(6);
+        proxyPauseHTTPSample.addKeyListener(this);
+        proxyPauseHTTPSample.setName(PROXY_PAUSE_HTTP_SAMPLER);
+        proxyPauseHTTPSample.setActionCommand(ENABLE_RESTART);
+        JLabel labelProxyPause= new JLabel(JMeterUtils.getResString("proxy_pause_http_sampler"));
// $NON-NLS-1$
+        labelProxyPause.setLabelFor(proxyPauseHTTPSample);
+
         JLabel labelSamplerType = new JLabel(JMeterUtils.getResString("proxy_sampler_type"));
// $NON-NLS-1$
         labelSamplerType.setLabelFor(samplerTypeName);
               
@@ -842,6 +874,13 @@ public class ProxyControlGui extends Log
         gbc.weightx = 3;
         gbc.fill=GridBagConstraints.HORIZONTAL;
         panel.add(prefixHTTPSampleName, gbc.clone());
+        gbc.gridx = 0;
+        gbc.gridy++;
+        panel.add(labelProxyPause, gbc.clone());
+        gbc.gridx++;
+        gbc.weightx = 3;
+        gbc.fill=GridBagConstraints.HORIZONTAL;
+        panel.add(proxyPauseHTTPSample, gbc.clone());
         gbc.weightx = 1;
         gbc.gridx = 0;
         gbc.gridy++;

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1807583&r1=1807582&r2=1807583&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Sep  7 10:33:30 2017
@@ -97,6 +97,7 @@ Incorporated feed back about unclear doc
 <ul>
     <li><bug>61056</bug>HTTP : Support brotli decoding</li>
     <li><bug>61135</bug>CookieManager : Drop Implementation select box
and cleanup class</li>
+    <li><bug>61492</bug>HTTP(S) Test Script Recorder : Add the possibility
to change the value of proxy.pause in the GUI</li>
 </ul>
 
 <h3>Other samplers</h3>

Modified: jmeter/trunk/xdocs/images/screenshots/proxy_control.png
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/images/screenshots/proxy_control.png?rev=1807583&r1=1807582&r2=1807583&view=diff
==============================================================================
Binary files - no diff available.



Mime
View raw message