Bug 57956 - The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin

Bugzilla Id: 57956

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1685333 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 6318068ef3
This commit is contained in:
Philippe Mouawad 2015-06-13 21:17:47 +00:00
parent 0f8a64c1e9
commit 6ac50d042b
3 changed files with 12 additions and 3 deletions

View File

@ -64,6 +64,7 @@ import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.httpclient.params.HttpParams;
import org.apache.commons.httpclient.protocol.Protocol;
import org.apache.commons.io.input.CountingInputStream;
import org.apache.jmeter.NewDriver;
import org.apache.jmeter.protocol.http.control.AuthManager;
import org.apache.jmeter.protocol.http.control.Authorization;
import org.apache.jmeter.protocol.http.control.CacheManager;
@ -136,7 +137,10 @@ public class HTTPHC3Impl extends HTTPHCAbstractImpl {
// Process Commons HttpClient parameters file
String file=JMeterUtils.getProperty("httpclient.parameters.file"); // $NON-NLS-1$
if (file != null) {
HttpClientDefaultParameters.load(file, params);
log.info("Loading httpclient parameters file from:"+file);
HttpClientDefaultParameters.load(NewDriver.getJMeterDir() + File.separator
+ "bin" + File.separator // $NON-NLS-1$
+ file, params);
}
// If the pre-emptive parameter is undefined, then we can set it as needed

View File

@ -105,6 +105,7 @@ import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import org.apache.jmeter.NewDriver;
import org.apache.jmeter.protocol.http.control.AuthManager;
import org.apache.jmeter.protocol.http.control.CacheManager;
import org.apache.jmeter.protocol.http.control.CookieManager;
@ -213,7 +214,10 @@ public class HTTPHC4Impl extends HTTPHCAbstractImpl {
// Process Apache HttpClient parameters file
String file=JMeterUtils.getProperty("hc.parameters.file"); // $NON-NLS-1$
if (file != null) {
HttpClientDefaultParameters.load(file, DEFAULT_HTTP_PARAMS);
log.info("Loading hc parameters file from:"+file);
HttpClientDefaultParameters.load(NewDriver.getJMeterDir() + File.separator
+ "bin" + File.separator // $NON-NLS-1$
+ file, DEFAULT_HTTP_PARAMS);
}
// Set up HTTP scheme override if necessary
@ -416,7 +420,7 @@ public class HTTPHC4Impl extends HTTPHCAbstractImpl {
if (res.getEndTime() == 0) {
res.sampleEnd();
}
// pick up headers if failed to execute the request
// pick up headers if failed to execute the request
if (res.getRequestHeaders() != null) {
log.debug("Overwriting request old headers: " + res.getRequestHeaders());
}

View File

@ -128,6 +128,7 @@ Summary
<li><bug>57806</bug>"audio/x-mpegurl" mime type is erroneously considered as binary by ViewResultsTree. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
<li><bug>57858</bug>Don't call sampleEnd twice in HTTPHC4Impl when a RuntimeException or an IOException occurs in the sample method.</li>
<li><bug>57921</bug>HTTP/1.1 without keep-alive "Connection" response header no longer uses infinite keep-alive.</li>
<li><bug>57956</bug>The hc.parameters reference in jmeter.properties doesn't work when JMeter is not started in bin.</li>
</ul>
<h3>Other Samplers</h3>