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 2018/04/02 12:32:20 UTC
svn commit: r1828164 - in /jmeter/trunk: bin/testfiles/TEST_HTTP.jmx
src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
xdocs/changes.xml
Author: pmouawad
Date: Mon Apr 2 12:32:20 2018
New Revision: 1828164
URL: http://svn.apache.org/viewvc?rev=1828164&view=rev
Log:
Bug 62248 - HTTP Request : Parameters entered in Parameters Tab should be used in body instead of being ignored
This closes #378
Based on patch by Artem Fedorov
Bugzilla Id: 62248
Modified:
jmeter/trunk/bin/testfiles/TEST_HTTP.jmx
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
jmeter/trunk/xdocs/changes.xml
Modified: jmeter/trunk/bin/testfiles/TEST_HTTP.jmx
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/TEST_HTTP.jmx?rev=1828164&r1=1828163&r2=1828164&view=diff
==============================================================================
--- jmeter/trunk/bin/testfiles/TEST_HTTP.jmx (original)
+++ jmeter/trunk/bin/testfiles/TEST_HTTP.jmx Mon Apr 2 12:32:20 2018
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3-SNAPSHOT.20170902">
+<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.1-SNAPSHOT.20180402">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
@@ -28,7 +28,7 @@
</SetupThreadGroup>
<hashTree>
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="JSS_startMirror" enabled="true">
- <stringProp name="cacheKey">877b8f57-5272-402c-bc11-cddbd4e69d71</stringProp>
+ <stringProp name="cacheKey">true</stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="script">import org.apache.jmeter.protocol.http.control.HttpMirrorServer;
@@ -85,6 +85,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoContentLength" enabled="true">
@@ -95,6 +96,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -134,6 +136,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -147,6 +150,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -185,6 +189,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -198,6 +203,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -242,6 +248,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
@@ -255,6 +262,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -338,6 +346,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoContentLength" enabled="true">
@@ -348,6 +357,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -357,6 +367,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -386,6 +397,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoContentLength" enabled="true">
@@ -396,6 +408,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoGzip_IN_REQUEST" enabled="true">
@@ -405,6 +418,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -414,6 +428,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -490,6 +505,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoContentLength" enabled="true">
@@ -500,6 +516,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -560,6 +577,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoContentLength" enabled="true">
@@ -570,6 +588,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -624,6 +643,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_message</stringProp>
<boolProp name="Assertion.assume_success">true</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_NoContentLength" enabled="true">
@@ -634,6 +654,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -680,6 +701,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_message</stringProp>
<boolProp name="Assertion.assume_success">true</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -762,6 +784,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -828,6 +851,7 @@ mirrorServer.start();</stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -901,11 +925,12 @@ mirrorServer.start();</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
<stringProp name="TestPlan.comments">Content-Type: multipart/form-data; boundary=</stringProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223-Assertion-CheckCorrectEncodingForParam" enabled="true">
<stringProp name="TestPlan.comments">Workaround as Mirror Server corrupts encoding</stringProp>
- <stringProp name="cacheKey">9e8a05ef-13b4-408f-a030-2702cfff8a88</stringProp>
+ <stringProp name="cacheKey">true</stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="script">String textToCheck = 'Content-Disposition: form-data; name="?_param"';
@@ -967,6 +992,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1033,6 +1059,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1083,6 +1110,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_response_contains" enabled="true">
@@ -1094,6 +1122,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -1106,6 +1135,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1161,6 +1191,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_response_contains" enabled="true">
@@ -1172,6 +1203,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -1184,6 +1216,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1238,6 +1271,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_response_contains" enabled="true">
@@ -1250,6 +1284,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -1262,6 +1297,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1314,6 +1350,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_response_contains" enabled="true">
@@ -1325,6 +1362,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -1337,6 +1375,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1393,6 +1432,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_response_contains" enabled="true">
@@ -1404,6 +1444,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
@@ -1414,6 +1455,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1471,6 +1513,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">20</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA_response_contains" enabled="true">
@@ -1478,21 +1521,23 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="1737626343">PUT /test?name0=value0 HTTP/1.1</stringProp>
<stringProp name="2117109222">Host: localhost:8081</stringProp>
<stringProp name="-1351522793">User-Agent:</stringProp>
+ <stringProp name="-2028138089">name1=value1</stringProp>
</collectionProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="RA" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="894172713">Connection: keep-alive</stringProp>
<stringProp name="-1680100360">Accept-Encoding: gzip</stringProp>
- <stringProp name="561439888">Content-Length: 0</stringProp>
</collectionProp>
<stringProp name="Assertion.test_field">Assertion.request_headers</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
+ <stringProp name="Assertion.custom_message"></stringProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -1517,7 +1562,7 @@ if(prev.getSamplerData().indexOf(textToC
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
- <stringProp name="cacheKey">6e41dc10-a2fc-4d6b-a7a2-e76a1ceb22c5</stringProp>
+ <stringProp name="cacheKey">true</stringProp>
<stringProp name="script">import org.apache.jmeter.protocol.http.control.HttpMirrorServer;
HttpMirrorServer mirrorServer = (HttpMirrorServer) props.get("MIRROR_SERVER");
@@ -1588,9 +1633,5 @@ mirrorServer.stopServer();</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
- <WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true">
- <boolProp name="WorkBench.save">true</boolProp>
- </WorkBench>
- <hashTree/>
</hashTree>
</jmeterTestPlan>
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1828164&r1=1828163&r2=1828164&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java Mon Apr 2 12:32:20 2018
@@ -1532,41 +1532,12 @@ public class HTTPHC4Impl extends HTTPHCA
postedBody.append(postBody.toString());
} else {
// It is a normal post request, with parameter names and values
-
// Set the content type
if(!hasContentTypeHeader) {
post.setHeader(HTTPConstants.HEADER_CONTENT_TYPE, HTTPConstants.APPLICATION_X_WWW_FORM_URLENCODED);
}
- // Add the parameters
- PropertyIterator args = getArguments().iterator();
- List <NameValuePair> nvps = new ArrayList<>();
String urlContentEncoding = contentEncoding;
- if(urlContentEncoding == null || urlContentEncoding.length() == 0) {
- // Use the default encoding for urls
- urlContentEncoding = EncoderCache.URL_ARGUMENT_ENCODING;
- }
- while (args.hasNext()) {
- HTTPArgument arg = (HTTPArgument) args.next().getObjectValue();
- // The HTTPClient always urlencodes both name and value,
- // so if the argument is already encoded, we have to decode
- // it before adding it to the post request
- String parameterName = arg.getName();
- if (arg.isSkippable(parameterName)){
- continue;
- }
- String parameterValue = arg.getValue();
- if(!arg.isAlwaysEncoded()) {
- // The value is already encoded by the user
- // Must decode the value now, so that when the
- // httpclient encodes it, we end up with the same value
- // as the user had entered.
- parameterName = URLDecoder.decode(parameterName, urlContentEncoding);
- parameterValue = URLDecoder.decode(parameterValue, urlContentEncoding);
- }
- // Add the parameter, httpclient will urlencode it
- nvps.add(new BasicNameValuePair(parameterName, parameterValue));
- }
- UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nvps, urlContentEncoding);
+ UrlEncodedFormEntity entity = createUrlEncodedFormEntity(urlContentEncoding);
post.setEntity(entity);
if (entity.isRepeatable()){
ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -1621,7 +1592,6 @@ public class HTTPHC4Impl extends HTTPHCA
// Only create this if we are overriding whatever default there may be
// If there are no arguments, we can send a file as the body of the request
-
if(!hasArguments() && getSendFileAsPostBody()) {
hasEntityBody = true;
@@ -1649,6 +1619,9 @@ public class HTTPHC4Impl extends HTTPHCA
}
StringEntity requestEntity = new StringEntity(entityBodyContent.toString(), charset);
entity.setEntity(requestEntity);
+ } else if (hasArguments()) {
+ hasEntityBody = true;
+ entity.setEntity(createUrlEncodedFormEntity(getContentEncodingOrNull()));
}
// Check if we have any content to send for body
if(hasEntityBody) {
@@ -1678,6 +1651,47 @@ public class HTTPHC4Impl extends HTTPHCA
}
/**
+ * Create UrlEncodedFormEntity from parameters
+ * @param contentEncoding Content encoding may be null or empty
+ * @return {@link UrlEncodedFormEntity}
+ * @throws UnsupportedEncodingException
+ */
+ private UrlEncodedFormEntity createUrlEncodedFormEntity(final String contentEncoding) throws UnsupportedEncodingException {
+ // It is a normal request, with parameter names and values
+ // Add the parameters
+ PropertyIterator args = getArguments().iterator();
+ List<NameValuePair> nvps = new ArrayList<>();
+ String urlContentEncoding = contentEncoding;
+ if (urlContentEncoding == null || urlContentEncoding.length() == 0) {
+ // Use the default encoding for urls
+ urlContentEncoding = EncoderCache.URL_ARGUMENT_ENCODING;
+ }
+ while (args.hasNext()) {
+ HTTPArgument arg = (HTTPArgument) args.next().getObjectValue();
+ // The HTTPClient always urlencodes both name and value,
+ // so if the argument is already encoded, we have to decode
+ // it before adding it to the post request
+ String parameterName = arg.getName();
+ if (arg.isSkippable(parameterName)) {
+ continue;
+ }
+ String parameterValue = arg.getValue();
+ if (!arg.isAlwaysEncoded()) {
+ // The value is already encoded by the user
+ // Must decode the value now, so that when the
+ // httpclient encodes it, we end up with the same value
+ // as the user had entered.
+ parameterName = URLDecoder.decode(parameterName, urlContentEncoding);
+ parameterValue = URLDecoder.decode(parameterValue, urlContentEncoding);
+ }
+ // Add the parameter, httpclient will urlencode it
+ nvps.add(new BasicNameValuePair(parameterName, parameterValue));
+ }
+ return new UrlEncodedFormEntity(nvps, urlContentEncoding);
+ }
+
+
+ /**
*
* @return the value of {@link #getContentEncoding()}; forced to null if empty
*/
Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java?rev=1828164&r1=1828163&r2=1828164&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java Mon Apr 2 12:32:20 2018
@@ -175,7 +175,32 @@ public class TestHTTPSamplersAgainstHttp
public void itemised_testGetRequest_Parameters3() throws Exception {
testGetRequest_Parameters(HTTP_SAMPLER3, item);
- }
+ }
+
+ public void testPutRequest_BodyFromParameterValues3() throws Exception {
+ testPutRequest_BodyFromParameterValues(HTTP_SAMPLER3, US_ASCII);
+ }
+
+ private void testPutRequest_BodyFromParameterValues(int samplerType, String samplerDefaultEncoding) throws Exception {
+
+ final String titleField = "titleKey"; // ensure only values are used
+ String titleValue = "mytitle";
+ final String descriptionField = "descriptionKey"; // ensure only values are used
+ String descriptionValue = "mydescription";
+
+ // Test sending data with default encoding
+ HTTPSamplerBase sampler = createHttpSampler(samplerType);
+ String contentEncoding = "";
+ setupUrl(sampler, contentEncoding);
+ sampler.setMethod(HTTPConstants.PUT);
+
+ setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);
+ ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);
+ ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);
+ HTTPSampleResult res = executeSampler(sampler);
+ String expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;
+ checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);
+ }
private void testPostRequest_UrlEncoded(int samplerType, String samplerDefaultEncoding, int test) throws Exception {
String titleField = "title";
Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1828164&r1=1828163&r2=1828164&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Mon Apr 2 12:32:20 2018
@@ -86,6 +86,7 @@ this behaviour, set <code>httpclient.res
<ul>
<li><bug>58757</bug>Fix deprecated methods of HTTPCLIENT after migration to httpclient-4.5.X. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
<li><bug>62212</bug>Recorder : Improve UX by providing a popup above all windows to be able to change Transaction names and pauses while using Browser. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+ <li><bug>62248</bug>HTTP Request : Parameters entered in Parameters Tab should be used in body instead of being ignored. Partly based on a patch by Artem Fedorov contributed by Blazemeter.</li>
</ul>
<h3>Other samplers</h3>
@@ -154,6 +155,7 @@ this behaviour, set <code>httpclient.res
<ul>
<li><bug>62114</bug>HTTP(S) Test Script Recorder : Client certificate authentication uses the first SSLManager created. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
<li><bug>61058</bug>HTTP Request : Deflate triggers "Unexpected end of ZLIB input stream". Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+ <li><bug>43612</bug>HTTP PUT does not honor request parameters. Implemented by Artem Fedorov (artem.fedorov at blazemeter.com) and contributed by BlazeMeter Ltd.</li>
</ul>
<h3>Other Samplers</h3>