Skip to content

Commit

Permalink
Bug 57928 - Add ability to define protocol (http/https) to AccessLogS…
Browse files Browse the repository at this point in the history
…ampler GUI

This closes #14
Bugzilla Id: 57928

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1679447 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pmouawad committed May 14, 2015
1 parent 46eb9d6 commit f573ba7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 1 deletion.
Expand Up @@ -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;
Expand Down Expand Up @@ -278,6 +280,29 @@ public String getPortString() {
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;
}

/**
*
Expand Down
Expand Up @@ -43,7 +43,7 @@ public AccessLogSamplerBeanInfo() {
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$
Expand Down Expand Up @@ -81,6 +81,10 @@ public AccessLogSamplerBeanInfo() {
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$
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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
2 changes: 2 additions & 0 deletions xdocs/changes.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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/>
Expand Down
1 change: 1 addition & 0 deletions xdocs/usermanual/component_reference.xml
Expand Up @@ -1077,6 +1077,7 @@ for all the methods. For an example of how to implement either interface, refer
<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>
Expand Down

0 comments on commit f573ba7

Please sign in to comment.