jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1576110 - in /jmeter/trunk: bin/jmeter.properties src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java xdocs/changes.xml
Date Mon, 10 Mar 2014 22:34:31 GMT
Author: pmouawad
Date: Mon Mar 10 22:34:31 2014
New Revision: 1576110

URL: http://svn.apache.org/r1576110
Log:
Bug 56228 - View Results Tree : Improve ergonomy by changing placement of Renderers and allowing
custom ordering
Bugzilla Id: 56228

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

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1576110&r1=1576109&r2=1576110&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Mon Mar 10 22:34:31 2014
@@ -963,6 +963,12 @@ beanshell.server.file=../extras/startup.
 # Set to 0 to disable the size check
 #view.results.tree.max_size=0
 
+# Order of Renderers in View Results Tree
+# Note full class names should be used for non jmeter core renderers
+# For JMeter core renderers, class names start with . and are automatically
+# prefixed with org.apache.jmeter.visualizers
+view.results.tree.renderers_order=.RenderAsText,.RenderAsRegexp,.RenderAsCssJQuery,.RenderAsXPath,.RenderAsHTML,.RenderAsHTMLWithEmbedded,.RenderAsDocument,.RenderAsJSON,.RenderAsXML
+
 # Maximum size of Document that can be parsed by Tika engine; defaut=10 * 1024 * 1024 (10MB)
 # Set to 0 to disable the size check
 #document.max_size=0

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=1576110&r1=1576109&r2=1576110&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
Mon Mar 10 22:34:31 2014
@@ -32,7 +32,9 @@ import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.io.IOException;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.swing.ComboBoxModel;
 import javax.swing.DefaultComboBoxModel;
@@ -108,6 +110,10 @@ implements ActionListener, TreeSelection
     private static final int MAX_DISPLAY_SIZE =
         JMeterUtils.getPropDefault("view.results.tree.max_size", 200 * 1024); // $NON-NLS-1$
 
+    // default display order
+    private static final String VIEWERS_ORDER =
+        JMeterUtils.getPropDefault("view.results.tree.renderers_order", ""); // $NON-NLS-1$
//$NON-NLS-2$
+
     private ResultRenderer resultsRender = null;
 
     private TreeSelectionEvent lastSelectionEvent;
@@ -288,13 +294,11 @@ implements ActionListener, TreeSelection
 
         VerticalPanel leftPane = new VerticalPanel();
         leftPane.add(treePane, BorderLayout.CENTER);
-        VerticalPanel leftDownPane = new VerticalPanel();
-        leftDownPane.add(createComboRender(), BorderLayout.NORTH);
+        leftPane.add(createComboRender(), BorderLayout.NORTH);
         autoScrollCB = new JCheckBox(JMeterUtils.getResString("view_results_autoscroll"));
// $NON-NLS-1$
         autoScrollCB.setSelected(false);
         autoScrollCB.addItemListener(this);
-        leftDownPane.add(autoScrollCB, BorderLayout.SOUTH);
-        leftPane.add(leftDownPane, BorderLayout.SOUTH);
+        leftPane.add(autoScrollCB, BorderLayout.SOUTH);
         return leftPane;
     }
 
@@ -318,6 +322,7 @@ implements ActionListener, TreeSelection
         }
         String textRenderer = JMeterUtils.getResString("view_results_render_text"); // $NON-NLS-1$
         Object textObject = null;
+        Map<String, ResultRenderer> map = new HashMap<String, ResultRenderer>(classesToAdd.size());
         for (String clazz : classesToAdd) {
             try {
                 // Instantiate render classes
@@ -326,11 +331,30 @@ implements ActionListener, TreeSelection
                     textObject=renderer;
                 }
                 renderer.setBackgroundColor(getBackground());
-                selectRenderPanel.addItem(renderer);
+                map.put(renderer.getClass().getName(), renderer);
             } catch (Exception e) {
-                log.warn("Error in load result render:" + clazz, e);
+                log.warn("Error loading result renderer:" + clazz, e);
             }
         }
+        if(VIEWERS_ORDER.length()>0) {
+            String[] keys = VIEWERS_ORDER.split(",");
+            for (String key : keys) {
+                if(key.startsWith(".")) {
+                    key = "org.apache.jmeter.visualizers"+key; //$NON-NLS-1$
+                }
+                ResultRenderer renderer = map.remove(key);
+                if(renderer != null) {
+                    selectRenderPanel.addItem(renderer);
+                } else {
+                    log.warn("Missing (check spelling error in renderer name) or already
added(check doublon) " +
+                    		"result renderer, check property 'view.results.tree.renderers_order',
renderer name:'"+key+"'");
+                }
+            }
+        }
+        // Add remaining (plugins or missed in property)
+        for (ResultRenderer renderer : map.values()) {
+            selectRenderPanel.addItem(renderer);
+        }
         nodesModel.setSelectedItem(textObject); // preset to "Text" option
         return selectRenderPanel;
     }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1576110&r1=1576109&r2=1576110&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Mar 10 22:34:31 2014
@@ -145,6 +145,7 @@ A workaround is to use a Java 7 update 4
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
 <ul>
 <li><bugzilla>56162</bugzilla> -  HTTP Cache Manager should not cache PUT/POST
etc.</li>
+<li><bugzilla>56227</bugzilla> - AssertionGUI : NPE in assertion on mouse
selection</li>
 </ul>
 
 <h3>Functions</h3>
@@ -185,11 +186,11 @@ A workaround is to use a Java 7 update 4
 
 <h3>Listeners</h3>
 <ul>
+<li><bugzilla>56228</bugzilla> - View Results Tree : Improve ergonomy by
changing placement of Renderers and allowing custom ordering</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
 <ul>
-<li><bugzilla>56227</bugzilla> - AssertionGUI : NPE in assertion on mouse
selection</li>
 </ul>
 
 <h3>Functions</h3>
@@ -225,6 +226,7 @@ A workaround is to use a Java 7 update 4
 We also thank bug reporters who helped us improve JMeter. <br/>
 For this release we want to give special thanks to the following reporters for the clear
reports and tests made after our fixes:
 <ul>
+<li>Oliver LLoyd (email at oliverlloyd.com)</li>
 </ul>
 
 Apologies if we have omitted anyone else.



Mime
View raw message