jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1658810 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java src/core/org/apache/jmeter/resources/messages.properties src/core/org/apache/jmeter/resources/messages_fr.properties xdocs/changes.xml
Date Tue, 10 Feb 2015 21:08:45 GMT
Author: pmouawad
Date: Tue Feb 10 21:08:44 2015
New Revision: 1658810

URL: http://svn.apache.org/r1658810
Log:
Bug 57562 - View Results Tree CSS/JQuery Tester : Nothing happens when there is an error in
syntax and an exception occurs in jmeter.log
Bugzilla Id: 57562

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java?rev=1658810&r1=1658809&r2=1658810&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java Tue Feb
10 21:08:44 2015
@@ -29,6 +29,7 @@ import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -121,19 +122,28 @@ public class RenderAsCssJQuery implement
     }
 
     private String process(String textToParse) {
-        List<String> result = new ArrayList<String>();
-        Extractor extractor = HtmlExtractor.getExtractorImpl(cssJqueryLabeledChoice.getText());
-        final int nbFound = extractor.extract(
-                cssJqueryField.getText(), attributeField.getText(), -1, textToParse, result,
0, null);
-
-        // Construct a multi-line string with all matches
-        StringBuilder sb = new StringBuilder();
-        sb.append("Match count: ").append(nbFound).append("\n");
-        for (int j = 0; j < nbFound; j++) {
-            String mr = result.get(j);
-            sb.append("Match[").append(j+1).append("]=").append(mr).append("\n");
+        try {
+            List<String> result = new ArrayList<String>();
+            Extractor extractor = HtmlExtractor.getExtractorImpl(cssJqueryLabeledChoice.getText());
+            final int nbFound = extractor.extract(
+                    cssJqueryField.getText(), attributeField.getText(), -1, textToParse,
result, 0, null);
+
+            // Construct a multi-line string with all matches
+            StringBuilder sb = new StringBuilder();
+            sb.append("Match count: ").append(nbFound).append("\n");
+            for (int j = 0; j < nbFound; j++) {
+                String mr = result.get(j);
+                sb.append("Match[").append(j+1).append("]=").append(mr).append("\n");
+            }
+            return sb.toString();
+        } catch (Exception ex) {
+            StringBuilder sb = new StringBuilder();
+            String message = MessageFormat.format(
+                    JMeterUtils.getResString("cssjquery_tester_error") // $NON-NLS-1$
+                    , new Object[]{cssJqueryField.getText(), ex.getMessage()});
+            sb.append(message);
+            return sb.toString();
         }
-        return sb.toString();
 
     }
     /** {@inheritDoc} */

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1658810&r1=1658809&r2=1658810&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Tue Feb 10 21:08:44
2015
@@ -213,6 +213,7 @@ countlim=Size limit
 critical_section_controller_label=Lock name
 critical_section_controller_title=Critical Section Controller
 cssjquery_attribute=Attribute\:
+cssjquery_tester_error=An error occured evaluating expression:{0}, error:{1}
 cssjquery_impl=CSS/JQuery implementation\:
 cssjquery_render_no_text=Data response result isn't text.
 cssjquery_tester_button_test=Test

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1658810&r1=1658809&r2=1658810&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Tue Feb 10 21:08:44
2015
@@ -206,6 +206,7 @@ countlim=Limiter le nombre d'\u00E9l\u00
 critical_section_controller_label=Nom du verrou
 critical_section_controller_title=Contr\u00F4leur Section critique
 cssjquery_attribute=Attribut
+cssjquery_tester_error=Une erreur s''est produite lors de l''\u00E9valuation de l''expression:{0},
erreur:{1}
 cssjquery_impl=Impl\u00E9mentation CSS/JQuery\:
 cssjquery_render_no_text=Les donn\u00E9es de r\u00E9ponse ne sont pas du texte.
 cssjquery_tester_button_test=Tester

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1658810&r1=1658809&r2=1658810&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Feb 10 21:08:44 2015
@@ -159,6 +159,7 @@ See  <bugzilla>56357</bugzilla> for deta
 <li><bug>57262</bug>Aggregate Report, Aggregate Graph and Summary Report
export : headers use keys instead of labels</li>
 <li><bug>57346</bug>Summariser : The + (difference) reports show wrong
elapsed time and throughput</li>
 <li><bug>57449</bug>Distributed Testing: Stripped modes do not strip responses
from SubResults (affects load tests that use Download of embedded resources). Contributed
by Ubik Load Pack (support at ubikloadpack.com)</li>
+<li><bug>57562</bug>View Results Tree CSS/JQuery Tester : Nothing happens
when there is an error in syntax and an exception occurs in jmeter.log</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



Mime
View raw message