jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1797423 - in /jmeter/trunk: src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java xdocs/changes.xml
Date Fri, 02 Jun 2017 20:04:13 GMT
Author: pmouawad
Date: Fri Jun  2 20:04:13 2017
New Revision: 1797423

URL: http://svn.apache.org/viewvc?rev=1797423&view=rev
Log:
Bug 61151 - Report/Dashboard : Top 5 Errors by Sampler and Errors : If assertion contains
html code, the html part is hidden
Bugzilla Id: 61151

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
    jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java?rev=1797423&r1=1797422&r2=1797423&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java Fri
Jun  2 20:04:13 2017
@@ -89,7 +89,7 @@ public class ErrorsSummaryConsumer exten
         String responseCode = sample.getResponseCode();
         String responseMessage = sample.getResponseMessage();
         String key = responseCode + (!StringUtils.isEmpty(responseMessage) ? 
-                 "/" + StringEscapeUtils.escapeJson(responseMessage) : "");
+                 "/" + StringEscapeUtils.escapeJson(StringEscapeUtils.escapeHtml4(responseMessage))
: "");
         if (isSuccessCode(responseCode) || 
                 (StringUtils.isEmpty(responseCode) && 
                         !StringUtils.isEmpty(sample.getFailureMessage()))) {
@@ -97,7 +97,7 @@ public class ErrorsSummaryConsumer exten
             if (ASSERTION_RESULTS_FAILURE_MESSAGE) {
                 String msg = sample.getFailureMessage();
                 if (!StringUtils.isEmpty(msg)) {
-                    key = StringEscapeUtils.escapeJson(msg);
+                    key = StringEscapeUtils.escapeJson(StringEscapeUtils.escapeHtml4(msg));
                 }
             }
         }

Modified: jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java?rev=1797423&r1=1797422&r2=1797423&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
(original)
+++ jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
Fri Jun  2 20:04:13 2017
@@ -35,6 +35,16 @@ public class ErrorsSummaryConsumerTest {
         sample = new Sample(0, metadata, new String[] { "false", "200", "", "FailureMessage"
});
         Assert.assertEquals("FailureMessage", ErrorsSummaryConsumer.getErrorKey(sample));
         
+        sample = new Sample(0, metadata, new String[] { "false", "200", "", 
+                "Test failed: text expected to contain /<title>Some html text</title>/"
});
+        Assert.assertEquals("Test failed: text expected to contain \\/&lt;title&gt;Some
html text&lt;\\/title&gt;\\/", 
+                ErrorsSummaryConsumer.getErrorKey(sample));
+        
+        sample = new Sample(0, metadata, new String[] { "false", "200", "", 
+                "Test failed: text expected to contain /{\"glossary\": { \"title\": \"example
glossary\"}}/" });
+        Assert.assertEquals("Test failed: text expected to contain \\/{&quot;glossary&quot;:
{ &quot;title&quot;: &quot;example glossary&quot;}}\\/", 
+                ErrorsSummaryConsumer.getErrorKey(sample));
+        
         sample = new Sample(0, metadata, new String[] { "true", "200", "", "" });
         Assert.assertEquals(ErrorsSummaryConsumer.ASSERTION_FAILED, ErrorsSummaryConsumer.getErrorKey(sample));
 

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1797423&r1=1797422&r2=1797423&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Fri Jun  2 20:04:13 2017
@@ -181,6 +181,7 @@ Summary
 <h3>Report / Dashboard</h3>
 <ul>
     <li><bug>61129</bug>Report/Dashboard : If response code is empty but
a failureMessage is present, Errors and Top 5 Errors are not accurate. Contributed by Ubik
Load Pack (support at ubikloadpack.com)</li>
+    <li><bug>61151</bug>Report/Dashboard : Top 5 Errors by Sampler and
Errors : If assertion contains html code, the html part is hidden</li>
 </ul>
 
 <h3>General</h3>



Mime
View raw message