jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1416061 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java xdocs/changes.xml
Date Sat, 01 Dec 2012 22:04:42 GMT
Author: pmouawad
Date: Sat Dec  1 22:04:41 2012
New Revision: 1416061

URL: http://svn.apache.org/viewvc?rev=1416061&view=rev
Log:
Bug 54226 - View Results Tree : Show response even when server does not return ContentType
header
Bugzilla Id: 54226

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java?rev=1416061&r1=1416060&r2=1416061&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
Sat Dec  1 22:04:41 2012
@@ -51,6 +51,7 @@ import javax.swing.tree.DefaultTreeModel
 import javax.swing.tree.TreePath;
 import javax.swing.tree.TreeSelectionModel;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.assertions.AssertionResult;
 import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.samplers.Clearable;
@@ -248,7 +249,7 @@ implements ActionListener, TreeSelection
             // display a SampleResult
             if (userObject instanceof SampleResult) {
                 SampleResult sampleResult = (SampleResult) userObject;
-                if ((SampleResult.TEXT).equals(sampleResult.getDataType())){
+                if (isTextDataType(sampleResult)){
                     resultsRender.renderResult(sampleResult);
                 } else {
                     byte[] responseBytes = sampleResult.getResponseData();
@@ -260,6 +261,15 @@ implements ActionListener, TreeSelection
         }
     }
 
+    /**
+     * @param sampleResult SampleResult
+     * @return true if sampleResult is text or has empty content type
+     */
+    protected static boolean isTextDataType(SampleResult sampleResult) {
+        return (SampleResult.TEXT).equals(sampleResult.getDataType())
+                || StringUtils.isEmpty(sampleResult.getDataType());
+    }
+
     private synchronized Component createLeftPanel() {
         SampleResult rootSampleResult = new SampleResult();
         rootSampleResult.setSampleLabel("Root");
@@ -356,7 +366,7 @@ implements ActionListener, TreeSelection
 
     public static String getResponseAsString(SampleResult res) {
         String response = null;
-        if ((SampleResult.TEXT).equals(res.getDataType())) {
+        if (isTextDataType(res)) {
             // Showing large strings can be VERY costly, so we will avoid
             // doing so if the response
             // data is larger than 200K. TODO: instead, we could delay doing

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1416061&r1=1416060&r2=1416061&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Dec  1 22:04:41 2012
@@ -102,6 +102,7 @@ It has been removed so now size of these
 </ul>
 </p>
 
+<p>View Results Tree now considers response with missing content type as text.</p>
 
 <!-- =================== Bug fixes =================== -->
 
@@ -182,6 +183,7 @@ and right angle bracket (&gt;) in search
 <ul>
 <li><bugzilla>54200</bugzilla> - Add support of several document types
(like Apache OpenOffice's files, MS Office's files, PDF's files, etc.) 
 to the elements View Results Tree, Assertion Response and Regular Expression Extractor (in
using Apache Tika)</li>
+<li><bugzilla>54226</bugzilla> - View Results Tree : Show response even
when server does not return ContentType header</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



Mime
View raw message