This is an automated email from the ASF dual-hosted git repository.
fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git
The following commit(s) were added to refs/heads/master by this push:
new d59da38 Freestyle format for names in (Default)SamplerCreator
d59da38 is described below
commit d59da3805edd0b2fc901e404bddf9de6d6051bc2
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Mon Aug 31 21:11:50 2020 +0200
Freestyle format for names in (Default)SamplerCreator
Don't save the default value for the format string property
Bugzilla Id: 64696
Relates to #595
---
.../org/apache/jmeter/protocol/http/proxy/ProxyControl.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
index 7bdc0be..4341da2 100644
--- a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
+++ b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
@@ -202,6 +202,9 @@ public class ProxyControl extends GenericController implements NonTestElement
{
// If this is defined, it is assumed to be the alias of a user-supplied certificate;
overrides dynamic mode
static final String CERT_ALIAS = JMeterUtils.getProperty("proxy.cert.alias"); // $NON-NLS-1$
+ private static final String DEFAULT_SAMPLER_FORMAT = JMeterUtils.getPropDefault("proxy.sampler_format",
+ "#{counter,number,000} - #{path} (#{name})");
+
public enum KeystoreMode {
USER_KEYSTORE, // user-provided keystore
JMETER_KEYSTORE, // keystore generated by JMeter; single entry
@@ -490,16 +493,11 @@ public class ProxyControl extends GenericController implements NonTestElement
{
}
public void setHttpSampleNameFormat(String text) {
- if (StringUtils.isBlank(text)) {
- removeProperty(HTTP_SAMPLER_FORMAT);
- } else {
- setProperty(new StringProperty(HTTP_SAMPLER_FORMAT, text));
- }
+ setProperty(HTTP_SAMPLER_FORMAT, text, DEFAULT_SAMPLER_FORMAT);
}
public String getHttpSampleNameFormat() {
- return getPropertyAsString(HTTP_SAMPLER_FORMAT,
- JMeterUtils.getPropDefault("proxy.sampler_format", "#{counter,number,000}
- #{path} (#{name})"));
+ return getPropertyAsString(HTTP_SAMPLER_FORMAT, DEFAULT_SAMPLER_FORMAT);
}
/**
|