You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2015/05/14 22:01:18 UTC

svn commit: r1679447 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/ xdocs/ xdocs/usermanual/

Author: pmouawad
Date: Thu May 14 20:01:17 2015
New Revision: 1679447

URL: http://svn.apache.org/r1679447
Log:
Bug 57928 - Add ability to define protocol (http/https) to AccessLogSampler GUI
This closes #14
Bugzilla Id: 57928

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources.properties
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources_fr.properties
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java?rev=1679447&r1=1679446&r2=1679447&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java Thu May 14 20:01:17 2015
@@ -18,7 +18,9 @@
 
 package org.apache.jmeter.protocol.http.sampler;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.protocol.http.control.CookieManager;
+import org.apache.jmeter.protocol.http.util.HTTPConstants;
 import org.apache.jmeter.protocol.http.util.accesslog.Filter;
 import org.apache.jmeter.protocol.http.util.accesslog.LogParser;
 import org.apache.jmeter.samplers.Entry;
@@ -278,6 +280,29 @@ public class AccessLogSampler extends HT
     public void setPortString(String port) {
         super.setProperty(HTTPSamplerBase.PORT, port);
     }
+    
+    /**
+     * Sets the scheme, with default
+     * @param value the protocol
+     */
+    @Override
+    public void setProtocol(String value) {
+        setProperty(PROTOCOL, value.toLowerCase(java.util.Locale.ENGLISH));
+    }
+    
+    /**
+     * Gets the protocol, with default.
+     *
+     * @return the protocol
+     */
+    @Override
+    public String getProtocol() {
+        String protocol = getPropertyAsString(PROTOCOL);
+        if (StringUtils.isEmpty(protocol)) {
+            return HTTPConstants.PROTOCOL_HTTP;
+        }
+        return protocol;
+    }
 
     /**
      *

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java?rev=1679447&r1=1679446&r2=1679447&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerBeanInfo.java Thu May 14 20:01:17 2015
@@ -43,7 +43,7 @@ public class AccessLogSamplerBeanInfo ex
         log.debug("Entered access log sampler bean info");
         try {
             createPropertyGroup("defaults",  // $NON-NLS-1$
-                    new String[] { "domain", "portString", "imageParsing" });// $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
+                    new String[] { "protocol", "domain", "portString", "imageParsing" });// $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ $NON-NLS-4$
 
             createPropertyGroup("plugins",  // $NON-NLS-1$
                     new String[] { "parserClassName", "filterClassName" }); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
@@ -81,6 +81,10 @@ public class AccessLogSamplerBeanInfo ex
             p.setValue(NOT_UNDEFINED, Boolean.TRUE);
             p.setValue(DEFAULT, "");
 
+            p = property("protocol"); // $NON-NLS-1$
+            p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+            p.setValue(DEFAULT, "http"); // $NON-NLS-1$
+
             p = property("portString"); // $NON-NLS-1$
             p.setValue(NOT_UNDEFINED, Boolean.TRUE);
             p.setValue(DEFAULT, ""); // $NON-NLS-1$

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources.properties?rev=1679447&r1=1679446&r2=1679447&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources.properties (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources.properties Thu May 14 20:01:17 2015
@@ -21,6 +21,8 @@ logFile.displayName=Log File
 logFile.shortDescription=Location of log file to parse for requests
 parserClassName.displayName=Parser
 parserClassName.shortDescription=Choose a parser implementation to parse your log file.
+protocol.displayName=Protocol
+protocol.shortDescription=Protocol to test against (http or https)
 filterClassName.displayName=Filter (Optional)
 filterClassName.shortDescription=Choose a filter implementation to filter your log file entries (optional).
 domain.displayName=Server

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources_fr.properties?rev=1679447&r1=1679446&r2=1679447&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources_fr.properties (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSamplerResources_fr.properties Thu May 14 20:01:17 2015
@@ -27,6 +27,8 @@ logFile.displayName=Fichier journal
 logFile.shortDescription=Emplacement du fichier journal \u00E0 analyser pour les requ\u00EAtes.
 parserClassName.displayName=Analyseur 
 parserClassName.shortDescription=Choisir une impl\u00E9mentation d'analyseur pour analyser votre fichier journal.
+protocol.displayName=Protocole
+protocol.shortDescription=Protocole du serveur de test (http or https)
 plugins.displayName=Extension de Classes
 portString.displayName=Port 
 portString.shortDescription=Num\u00E9ro de port de test

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1679447&r1=1679446&r2=1679447&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu May 14 20:01:17 2015
@@ -82,6 +82,7 @@ Summary
 
 <h3>Other samplers</h3>
 <ul>
+    <li><bug>57928</bug>Add ability to define protocol (http/https) to AccessLogSampler GUI. Contributed by Jérémie Lesage (jeremie.lesage at jeci.fr)</li>
 </ul>
 
 <h3>Controllers</h3>
@@ -164,6 +165,7 @@ Summary
 <ul>
 <li><a href="http://ubikloadpack.com">Ubik Load Pack</a></li>
 <li>Benoit Vatan (benoit.vatan at gmail.com)</li>
+<li>Jérémie Lesage (jeremie.lesage at jeci.fr)</li>
 </ul>
 
 <br/>

Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1679447&r1=1679446&r2=1679447&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/component_reference.xml Thu May 14 20:01:17 2015
@@ -1077,6 +1077,7 @@ for all the methods. For an example of h
 <properties>
         <property name="Name" required="No">Descriptive name for this sampler that is shown in the tree.</property>
         <property name="Server" required="Yes">Domain name or IP address of the web server.</property>
+        <property name="Protocol" required="No (defaults to http">Scheme</property>
         <property name="Port" required="No (defaults to 80)">Port the web server is listening to.</property>
         <property name="Log parser class" required="Yes (default provided)">The log parser class is responsible for parsing the logs.</property>
         <property name="Filter" required="No">The filter class is used to filter out certain lines.</property>