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 2014/07/12 14:57:07 UTC

svn commit: r1609912 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java xdocs/changes.xml

Author: pmouawad
Date: Sat Jul 12 12:57:07 2014
New Revision: 1609912

URL: http://svn.apache.org/r1609912
Log:
Bug 56706 - SampleResult#getResponseDataAsString() does not use encoding in response body impacting PostProcessors and ViewResultsTree
Bugzilla Id: 56706

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java?rev=1609912&r1=1609911&r2=1609912&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java Sat Jul 12 12:57:07 2014
@@ -205,6 +205,23 @@ public class HTTPSampleResult extends Sa
      * the Meta content-type if necessary.
      *
      * Updates the dataEncoding field if the content-type is found.
+     * @param defaultEncoding Default encoding used if there is no data encoding
+     * @return the dataEncoding value as a String
+     */
+    @Override
+    public String getDataEncodingWithDefault(String defaultEncoding) {
+        String dataEncodingNoDefault = getDataEncodingNoDefault();
+        if(dataEncodingNoDefault != null && dataEncodingNoDefault.length()> 0) {
+            return dataEncodingNoDefault;
+        }
+        return defaultEncoding;
+    }
+    
+    /**
+     * Overrides the method from SampleResult - so the encoding can be extracted from
+     * the Meta content-type if necessary.
+     *
+     * Updates the dataEncoding field if the content-type is found.
      *
      * @return the dataEncoding value as a String
      */

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1609912&r1=1609911&r2=1609912&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Jul 12 12:57:07 2014
@@ -150,6 +150,7 @@ A workaround is to use a Java 7 update 4
 
 <h3>Listeners</h3>
 <ul>
+<li><bugzilla>56706</bugzilla> - SampleResult#getResponseDataAsString() does not use encoding in response body impacting PostProcessors and ViewResultsTree. Contributed by Ubik Load Pack(support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
@@ -247,6 +248,7 @@ A workaround is to use a Java 7 update 4
 <li>James Liang (jliang at andera.com)</li>
 <li>Emmanuel Bourg (ebourg at apache.org)</li>
 <li>Nicola Ambrosetti (ambrosetti.nicola at gmail.com)</li>
+<li><a href="http://ubikloadpack.com">Ubik Load Pack support</a></li>
 </ul>
 
 <br/>