jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1302132 - in /jmeter/trunk: src/core/org/apache/jmeter/resources/ src/protocol/http/org/apache/jmeter/protocol/http/control/gui/ src/protocol/http/org/apache/jmeter/protocol/http/sampler/ xdocs/
Date Sun, 18 Mar 2012 14:27:25 GMT
Author: pmouawad
Date: Sun Mar 18 14:27:24 2012
New Revision: 1302132

URL: http://svn.apache.org/viewvc?rev=1302132&view=rev
Log:
Bug 52939 - Webservice Sampler : Make MaintainSession configurable

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/control/gui/WebServiceSamplerGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
    jmeter/trunk/xdocs/changes.xml

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=1302132&r1=1302131&r2=1302132&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Sun Mar 18 14:27:24
2012
@@ -1117,6 +1117,7 @@ web_testing_retrieve_images=Retrieve All
 web_testing_title=HTTP Request
 webservice_configuration_wizard=WSDL helper
 webservice_get_xml_from_random_title=Use random messages SOAP
+webservice_maintain_session=Maintain HTTP Session
 webservice_message_soap=WebService message
 webservice_methods=Web Methods
 webservice_proxy_host=Proxy Host

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=1302132&r1=1302131&r2=1302132&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 Sun Mar 18 14:27:24
2012
@@ -1111,6 +1111,7 @@ web_testing_retrieve_images=R\u00E9cup\u
 web_testing_title=Requ\u00EAte HTTP
 webservice_configuration_wizard=Assistant de configuration WSDL
 webservice_get_xml_from_random_title=Utiliser al\u00E9atoirement des messages SOAP
+webservice_maintain_session=Maintenir la Session HTTP
 webservice_message_soap=Message WebService
 webservice_methods=M\u00E9thode(s) WebService \:
 webservice_proxy_host=H\u00F4te proxy

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java?rev=1302132&r1=1302131&r2=1302132&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
Sun Mar 18 14:27:24 2012
@@ -73,6 +73,12 @@ public class WebServiceSamplerGui extend
 
     private final JLabeledTextField soapAction = new JLabeledTextField(JMeterUtils.getResString("webservice_soap_action"));
// $NON-NLS-1$
 
+    /**
+     * checkbox for Session maintenance.
+     */
+    private JCheckBox maintainSession = new JCheckBox(JMeterUtils.getResString("webservice_maintain_session"),
true); // $NON-NLS-1$
+
+    
     private JTextArea soapXml;
 
     private final JLabeledTextField wsdlField = new JLabeledTextField(JMeterUtils.getResString("wsdl_url"));
// $NON-NLS-1$
@@ -166,6 +172,7 @@ public class WebServiceSamplerGui extend
         sampler.setWsdlURL(wsdlField.getText());
         sampler.setMethod(HTTPSamplerBase.POST);
         sampler.setSoapAction(soapAction.getText());
+        sampler.setMaintainSession(maintainSession.isSelected());
         sampler.setXmlData(soapXml.getText());
         sampler.setXmlFile(soapXmlFile.getFilename());
         sampler.setXmlPathLoc(randomXmlFile.getText());
@@ -189,6 +196,7 @@ public class WebServiceSamplerGui extend
         port.setText(""); //$NON-NLS-1$
         path.setText(""); //$NON-NLS-1$
         soapAction.setText(""); //$NON-NLS-1$
+        maintainSession.setSelected(WebServiceSampler.MAINTAIN_SESSION_DEFAULT);
         soapXml.setText(""); //$NON-NLS-1$
         wsdlField.setText(""); //$NON-NLS-1$
         randomXmlFile.setText(""); //$NON-NLS-1$
@@ -263,11 +271,22 @@ public class WebServiceSamplerGui extend
         urlPane.add(connectTimeout);
         topPanel.add(urlPane);
         
-        topPanel.add(path);
-        topPanel.add(soapAction);
+        topPanel.add(createParametersPanel());
+        
         return topPanel;
     }
 
+    private final JPanel createParametersPanel() {
+        JPanel paramsPanel = new JPanel();
+        paramsPanel.setLayout(new BoxLayout(paramsPanel, BoxLayout.X_AXIS));
+        paramsPanel.add(path);
+        paramsPanel.add(Box.createHorizontalGlue());        
+        paramsPanel.add(soapAction);
+        paramsPanel.add(Box.createHorizontalGlue());        
+        paramsPanel.add(maintainSession);
+        return paramsPanel;
+    }
+    
     private final JPanel createMessagePanel() {
         JPanel msgPanel = new JPanel();
         msgPanel.setLayout(new BorderLayout(5, 0));
@@ -375,6 +394,7 @@ public class WebServiceSamplerGui extend
         port.setText(sampler.getPropertyAsString(HTTPSamplerBase.PORT));
         path.setText(sampler.getPath());
         soapAction.setText(sampler.getSoapAction());
+        maintainSession.setSelected(sampler.getMaintainSession());
         soapXml.setText(sampler.getXmlData());
         soapXml.setCaretPosition(0); // go to 1st line
         soapXmlFile.setFilename(sampler.getXmlFile());

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java?rev=1302132&r1=1302131&r2=1302132&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
Sun Mar 18 14:27:24 2012
@@ -78,6 +78,8 @@ public class WebServiceSampler extends H
 
     private static final String MEMORY_CACHE = "WebServiceSampler.memory_cache"; //$NON-NLS-1$
 
+    private static final String MAINTAIN_SESSION = "WebServiceSampler.maintain_session";
//$NON-NLS-1$
+    
     private static final String READ_RESPONSE = "WebServiceSampler.read_response"; //$NON-NLS-1$
 
     private static final String USE_PROXY = "WebServiceSampler.use_proxy"; //$NON-NLS-1$
@@ -99,6 +101,8 @@ public class WebServiceSampler extends H
 
     private static final String ENCODING = "UTF-8"; // $NON-NLS-1$ TODO should this be a
variable?
 
+    public static final boolean MAINTAIN_SESSION_DEFAULT = true;
+
     /*
      * Random class for generating random numbers.
      */
@@ -199,6 +203,24 @@ public class WebServiceSampler extends H
     }
 
     /**
+     * Set the maintain session option.
+     *
+     * @param cache
+     */
+    public void setMaintainSession(boolean maintainSession) {
+        setProperty(MAINTAIN_SESSION, maintainSession, MAINTAIN_SESSION_DEFAULT);
+    }
+
+    /**
+     * Get the maintain session option.
+     *
+     * @return boolean cache
+     */
+    public boolean getMaintainSession() {
+        return getPropertyAsBoolean(MAINTAIN_SESSION, MAINTAIN_SESSION_DEFAULT);
+    }
+    
+    /**
      * Set the memory cache.
      *
      * @param cache
@@ -504,8 +526,8 @@ public class WebServiceSampler extends H
                     }
                 }
             }
-            // by default we maintain the session.
-            spconn.setMaintainSession(true);
+            
+            spconn.setMaintainSession(getMaintainSession());
             msg.setSOAPTransport(spconn);
             msg.send(this.getUrl(), this.getSoapAction(), msgEnv);
             @SuppressWarnings("unchecked") // API uses raw types

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1302132&r1=1302131&r2=1302132&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Mar 18 14:27:24 2012
@@ -146,6 +146,7 @@ empty Name and Value are no more saved.
 <li>Bug 52775 - JMS Publisher : Add Non Persistent Delivery option</li>
 <li>Bug 52810 - Enable setting JMS Properties through JMS Publisher sampler</li>
 <li>Bug 52938 - Webservice Sampler : Add a jmeter property soap.document_cache to control
size of Document Cache</li>
+<li>Bug 52939 - Webservice Sampler : Make MaintainSession configurable</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message