You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by mi...@apache.org on 2017/02/16 18:54:20 UTC

svn commit: r1783272 - in /jmeter/trunk/src: core/org/apache/jmeter/resources/ protocol/http/org/apache/jmeter/protocol/http/config/gui/ protocol/http/org/apache/jmeter/protocol/http/control/gui/

Author: milamber
Date: Thu Feb 16 18:54:20 2017
New Revision: 1783272

URL: http://svn.apache.org/viewvc?rev=1783272&view=rev
Log:
Improve the Advanced tab UI since the HTTP client implementation and timeouts are moving into.
Bugzilla Id: 60543

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/config/gui/HttpDefaultsGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java

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=1783272&r1=1783271&r2=1783272&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Thu Feb 16 18:54:20 2017
@@ -1294,7 +1294,7 @@ web_parameters_lost_message=Switching to
 web_proxy_server_title=Proxy Server
 web_request=HTTP Request
 web_server=Web Server
-web_server_client=Client implementation:
+web_server_client=Client implementation
 web_server_domain=Server Name or IP\:
 web_server_port=Port Number\:
 web_server_timeout_connect=Connect:

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=1783272&r1=1783271&r2=1783272&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 Feb 16 18:54:20 2017
@@ -1284,7 +1284,7 @@ web_parameters_lost_message=Basculer ver
 web_proxy_server_title=Requ\u00EAte via un serveur proxy
 web_request=Requ\u00EAte HTTP
 web_server=Serveur web
-web_server_client=Impl\u00E9mentation client \:
+web_server_client=Impl\u00E9mentation client
 web_server_domain=Nom ou adresse IP \:
 web_server_port=Port \:
 web_server_timeout_connect=Connexion \:

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java?rev=1783272&r1=1783271&r2=1783272&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java Thu Feb 16 18:54:20 2017
@@ -46,7 +46,6 @@ import org.apache.jmeter.testelement.pro
 import org.apache.jmeter.testelement.property.IntegerProperty;
 import org.apache.jmeter.testelement.property.StringProperty;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.gui.JLabeledChoice;
 import org.apache.jorphan.gui.JLabeledTextField;
 
 /**
@@ -85,7 +84,7 @@ public class HttpDefaultsGui extends Abs
 
     private JPasswordField proxyPass;
     
-    private JLabeledChoice httpImplementation;
+    private JComboBox<String> httpImplementation = new JComboBox<>(HTTPSamplerFactory.getImplementations());
 
     private JTextField connectTimeOut;
 
@@ -170,7 +169,7 @@ public class HttpDefaultsGui extends Abs
         config.setProperty(HTTPSamplerBase.PROXYPORT, proxyPort.getText(),"");
         config.setProperty(HTTPSamplerBase.PROXYUSER, proxyUser.getText(),"");
         config.setProperty(HTTPSamplerBase.PROXYPASS, String.valueOf(proxyPass.getPassword()),"");
-        config.setProperty(HTTPSamplerBase.IMPLEMENTATION, httpImplementation.getText(),"");
+        config.setProperty(HTTPSamplerBase.IMPLEMENTATION, httpImplementation.getSelectedItem().toString(),"");
         config.setProperty(HTTPSamplerBase.CONNECT_TIMEOUT, connectTimeOut.getText());
         config.setProperty(HTTPSamplerBase.RESPONSE_TIMEOUT, responseTimeOut.getText());
 
@@ -195,7 +194,7 @@ public class HttpDefaultsGui extends Abs
         proxyPort.setText(""); // $NON-NLS-1$
         proxyUser.setText(""); // $NON-NLS-1$
         proxyPass.setText(""); // $NON-NLS-1$
-        httpImplementation.setText(""); // $NON-NLS-1$
+        httpImplementation.setSelectedItem(""); // $NON-NLS-1$
         connectTimeOut.setText(""); // $NON-NLS-1$
         responseTimeOut.setText(""); // $NON-NLS-1$
     }
@@ -219,7 +218,7 @@ public class HttpDefaultsGui extends Abs
         proxyPort.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYPORT));
         proxyUser.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYUSER));
         proxyPass.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYPASS));
-        httpImplementation.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.IMPLEMENTATION));
+        httpImplementation.setSelectedItem(samplerBase.getPropertyAsString(HTTPSamplerBase.IMPLEMENTATION));
         connectTimeOut.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.CONNECT_TIMEOUT));
         responseTimeOut.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.RESPONSE_TIMEOUT));
     }
@@ -231,11 +230,14 @@ public class HttpDefaultsGui extends Abs
         // URL CONFIG
         urlConfigGui = new UrlConfigGui(false, true, false);
 
+        // HTTP request options
+        JPanel httpOptions = new HorizontalPanel();
+        httpOptions.add(getImplementationPanel());
+        httpOptions.add(getTimeOutPanel());
         // AdvancedPanel (embedded resources, source address and optional tasks)
         JPanel advancedPanel = new VerticalPanel();
+        advancedPanel.add(httpOptions);
         advancedPanel.add(createEmbeddedRsrcPanel());
-        advancedPanel.add(getTimeOutPanel());
-        advancedPanel.add(getImplementationPanel());
         advancedPanel.add(createSourceAddrPanel());
         advancedPanel.add(getProxyServerPanel());
         advancedPanel.add(createOptionalTasksPanel());
@@ -376,9 +378,10 @@ public class HttpDefaultsGui extends Abs
      */
     protected final JPanel getImplementationPanel(){
         JPanel implPanel = new HorizontalPanel();
-        httpImplementation = new JLabeledChoice(JMeterUtils.getResString("http_implementation"), // $NON-NLS-1$
-                HTTPSamplerFactory.getImplementations());
-        httpImplementation.addValue("");
+        implPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
+                JMeterUtils.getResString("web_server_client"))); // $NON-NLS-1$
+        implPanel.add(new JLabel(JMeterUtils.getResString("http_implementation"))); // $NON-NLS-1$
+        httpImplementation.addItem("");// $NON-NLS-1$
         implPanel.add(httpImplementation);
         return implPanel;
     }

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java?rev=1783272&r1=1783271&r2=1783272&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java Thu Feb 16 18:54:20 2017
@@ -43,7 +43,6 @@ import org.apache.jmeter.protocol.http.s
 import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.gui.JLabeledChoice;
 import org.apache.jorphan.gui.JLabeledTextField;
 
 //For unit tests, @see TestHttpTestSampleGui
@@ -86,7 +85,7 @@ public class HttpTestSampleGui extends A
 
     private JPasswordField proxyPass;
     
-    private JLabeledChoice httpImplementation;
+    private JComboBox<String> httpImplementation = new JComboBox<>(HTTPSamplerFactory.getImplementations());
 
     private JTextField connectTimeOut;
 
@@ -123,7 +122,7 @@ public class HttpTestSampleGui extends A
             proxyPort.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYPORT));
             proxyUser.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYUSER));
             proxyPass.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYPASS));
-            httpImplementation.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.IMPLEMENTATION));
+            httpImplementation.setSelectedItem(samplerBase.getPropertyAsString(HTTPSamplerBase.IMPLEMENTATION));
             connectTimeOut.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.CONNECT_TIMEOUT));
             responseTimeOut.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.RESPONSE_TIMEOUT));
         }
@@ -162,7 +161,7 @@ public class HttpTestSampleGui extends A
             samplerBase.setProperty(HTTPSamplerBase.PROXYPORT, proxyPort.getText(),"");
             samplerBase.setProperty(HTTPSamplerBase.PROXYUSER, proxyUser.getText(),"");
             samplerBase.setProperty(HTTPSamplerBase.PROXYPASS, String.valueOf(proxyPass.getPassword()),"");
-            samplerBase.setProperty(HTTPSamplerBase.IMPLEMENTATION, httpImplementation.getText(),"");
+            samplerBase.setProperty(HTTPSamplerBase.IMPLEMENTATION, httpImplementation.getSelectedItem().toString(),"");
             samplerBase.setProperty(HTTPSamplerBase.CONNECT_TIMEOUT, connectTimeOut.getText());
             samplerBase.setProperty(HTTPSamplerBase.RESPONSE_TIMEOUT, responseTimeOut.getText());
         }
@@ -184,12 +183,17 @@ public class HttpTestSampleGui extends A
         // URL CONFIG
         urlConfigGui = new UrlConfigGui(true, true, true);
         
+        // HTTP request options
+        JPanel httpOptions = new HorizontalPanel();
+        httpOptions.add(getImplementationPanel());
+        httpOptions.add(getTimeOutPanel());
         // AdvancedPanel (embedded resources, source address and optional tasks)
         JPanel advancedPanel = new VerticalPanel();
+        if (!isAJP) {
+            advancedPanel.add(httpOptions);
+        }
         advancedPanel.add(createEmbeddedRsrcPanel());
         if (!isAJP) {
-            advancedPanel.add(getTimeOutPanel());
-            advancedPanel.add(getImplementationPanel());
             advancedPanel.add(createSourceAddrPanel());
             advancedPanel.add(getProxyServerPanel());
         }
@@ -283,9 +287,10 @@ public class HttpTestSampleGui extends A
      */
     protected final JPanel getImplementationPanel(){
         JPanel implPanel = new HorizontalPanel();
-        httpImplementation = new JLabeledChoice(JMeterUtils.getResString("http_implementation"), // $NON-NLS-1$
-                HTTPSamplerFactory.getImplementations());
-        httpImplementation.addValue("");
+        implPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
+                JMeterUtils.getResString("web_server_client"))); // $NON-NLS-1$
+        implPanel.add(new JLabel(JMeterUtils.getResString("http_implementation"))); // $NON-NLS-1$
+        httpImplementation.addItem("");// $NON-NLS-1$
         implPanel.add(httpImplementation);
         return implPanel;
     }
@@ -345,7 +350,7 @@ public class HttpTestSampleGui extends A
             proxyPort.setText(""); // $NON-NLS-1$
             proxyUser.setText(""); // $NON-NLS-1$
             proxyPass.setText(""); // $NON-NLS-1$
-            httpImplementation.setText(""); // $NON-NLS-1$
+            httpImplementation.setSelectedItem(""); // $NON-NLS-1$
             connectTimeOut.setText(""); // $NON-NLS-1$
             responseTimeOut.setText(""); // $NON-NLS-1$
         }