jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1828454 - /jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
Date Thu, 05 Apr 2018 16:34:01 GMT
Author: pmouawad
Date: Thu Apr  5 16:34:01 2018
New Revision: 1828454

URL: http://svn.apache.org/viewvc?rev=1828454&view=rev
Log:
Fix issue in tests:
- Method POST is not set which leads to  HTTPSamplerBase#getUseMultipartForPost() returning
false when it shouldn't

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java?rev=1828454&r1=1828453&r2=1828454&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java Thu
Apr  5 16:34:01 2018
@@ -164,6 +164,7 @@ public class PostWriterTest {
     @Test
     public void testSendPostData_NoFilename() throws IOException {
         setupNoFilename(sampler);
+        sampler.setMethod(HTTPConstants.POST);
         String titleValue = "mytitle";
         String descriptionValue = "mydescription";
         setupFormData(sampler, titleValue, descriptionValue);
@@ -206,6 +207,7 @@ public class PostWriterTest {
      */
     @Test
     public void testSendPostData_FileAsBody() throws IOException {
+        sampler.setMethod(HTTPConstants.POST);
         setupFilepart(sampler, "", temporaryFile, "");
         
         // Check using default encoding
@@ -419,7 +421,8 @@ public class PostWriterTest {
 
         // Test sending data with default encoding
         String contentEncoding = "";
-        sampler.setContentEncoding(contentEncoding);        
+        sampler.setContentEncoding(contentEncoding);
+        sampler.setMethod(HTTPConstants.POST);
         postWriter.setHeaders(connection, sampler);
         postWriter.sendPostData(connection, sampler);
         
@@ -605,6 +608,7 @@ public class PostWriterTest {
      */
     @Test
     public void testSetHeaders_NoFilename() throws IOException {
+        sampler.setMethod(HTTPConstants.POST);
         setupNoFilename(sampler);
         setupFormData(sampler);
         



Mime
View raw message