Author: pmouawad
Date: Thu Nov 16 22:16:39 2017
New Revision: 1815517

URL: http://svn.apache.org/viewvc?rev=1815517&view=rev
Log:
Bug 61770 - Module Controller : Inform user in UI that he needs to have at 
least one Controller in his plan
Also mention the enhancements and bugfixes contributed by UbikLoadPack
Bugzilla Id: 61770

Modified:
    
jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.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/control/gui/ModuleControllerGui.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java?rev=1815517&r1=1815516&r2=1815517&view=diff
==============================================================================
--- 
jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java
 (original)
+++ 
jmeter/trunk/src/components/org/apache/jmeter/control/gui/ModuleControllerGui.java
 Thu Nov 16 22:16:39 2017
@@ -102,6 +102,11 @@ public class ModuleControllerGui extends
     private JButton expandButton;
 
     /**
+     * Use this to warn about no selectable controller
+     */
+    private boolean hasAtLeastOneController;
+
+    /**
      * Initializes the gui panel for the ModuleController instance.
      */
     public ModuleControllerGui() {
@@ -259,6 +264,7 @@ public class ModuleControllerGui extends
     public void clearGui() {
         super.clearGui();
         selected = null;
+        hasAtLeastOneController = false;
     }
 
     /** {@inheritDoc}} */
@@ -377,6 +383,10 @@ public class ModuleControllerGui extends
             //expand Module to run tree to selected node and set selection 
path to it
             this.focusSelectedOnTree(selected);
         }
+        if(!hasAtLeastOneController) {
+            
warningLabel.setText(JMeterUtils.getResString("module_controller_warning_no_controller"));
+            warningLabel.setVisible(true);
+        }
     }
 
     /**
@@ -392,22 +402,21 @@ public class ModuleControllerGui extends
      */
     private void buildTreeNodeModel(JMeterTreeNode node, int level,
             DefaultMutableTreeNode parent) {
-
         if (node != null) {
             for (int i = 0; i < node.getChildCount(); i++) {
                 JMeterTreeNode cur = (JMeterTreeNode) node.getChildAt(i);
                 TestElement te = cur.getTestElement();
-
-                if (te instanceof Controller
-                        && !(te instanceof ModuleController) && level > 0) {
-                    DefaultMutableTreeNode newNode = new 
DefaultMutableTreeNode(cur);
-                    parent.add(newNode);
-                    buildTreeNodeModel(cur, level + 1, newNode);
-                } else if (te instanceof TestFragmentController
-                        || te instanceof AbstractThreadGroup) {
+                if (te instanceof TestFragmentController
+                        || te instanceof AbstractThreadGroup
+                        || (te instanceof Controller
+                                && !(te instanceof ModuleController) && level 
> 0)) {
                     DefaultMutableTreeNode newNode = new 
DefaultMutableTreeNode(cur);
                     parent.add(newNode);
                     buildTreeNodeModel(cur, level + 1, newNode);
+                    hasAtLeastOneController = 
+                            hasAtLeastOneController || (
+                                    te instanceof Controller && 
+                                    !(te instanceof ModuleController || te 
instanceof AbstractThreadGroup));
                 } else if (te instanceof TestPlan) {
                     ((DefaultMutableTreeNode) moduleToRunTreeModel.getRoot())
                             .setUserObject(cur);

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=1815517&r1=1815516&r2=1815517&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Thu 
Nov 16 22:16:39 2017
@@ -713,7 +713,8 @@ modify_test=Modify Test
 modtest=Modification test
 module_controller_module_to_run=Module To Run 
 module_controller_title=Module Controller
-module_controller_warning=Could not find module: 
+module_controller_warning=Could not find module\:
+module_controller_warning_no_controller=You need to have at least 1 Controller 
(Module Controller are excluded)
 name=Name\:
 new=New
 newdn=New distinguished name

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=1815517&r1=1815516&r2=1815517&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 
Thu Nov 16 22:16:39 2017
@@ -704,6 +704,7 @@ modtest=Modification
 module_controller_module_to_run=Module \u00E0 ex\u00E9cuter \:
 module_controller_title=Contr\u00F4leur Module
 module_controller_warning=Ne peut pas trouver le module \:
+module_controller_warning_no_controller=Vous devez avoir au moins 1 
contr\u00f4leur (les contr\u00f4leurs de module sont exclus)
 name=Nom \:
 new=Nouveau
 newdn=Nouveau DN

Modified: jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1815517&r1=1815516&r2=1815517&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Nov 16 22:16:39 2017
@@ -107,12 +107,13 @@ Summary
 <h3>Controllers</h3>
 <ul>
     <li><bug>61675</bug>If Controller : Use expression by default and add a 
warning when the other mode is used. Contributed by Ubik Load Pack (support at 
ubikloadpack.com)</li>
+    <li><bug>61770</bug>Module Controller : Inform user in UI that he needs to 
have at least one Controller in his plan. Contributed by Ubik Load Pack 
(support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Listeners</h3>
 <ul>
     <li><bug>57760</bug>View Results Tree : Cookie Header is wrongly shown as 
empty(no cookies) when viewing a recorder Sample Result. Contributed by Ubik 
Load Pack (support at ubikloadpack.com)</li>
-    <li><bug>61769</bug>View Results Tree: Use syntax highlighter in XPath 
Tester, JSON Path Tester and CSS/JQuery Tester</li>
+    <li><bug>61769</bug>View Results Tree: Use syntax highlighter in XPath 
Tester, JSON Path Tester and CSS/JQuery Tester. Contributed by Ubik Load Pack 
(support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
@@ -122,13 +123,13 @@ Summary
     <li><bug>61645</bug>Response Assertion : Add ability to assert on Request 
Data</li>
     <li><bug>61534</bug>Convert AssertionError to a failed assertion in the 
JSR223Assertion allowing users to use assert in their code</li>
     <li><bug>61756</bug>Extractors : Improve label name "Reference name" to 
make it clear what it makes</li>
-    <li><bug>61758</bug><code>Apply to:</code> field in Extractors, Assertions 
: When entering a value in <code>JMeter Variable Name</code>, the radio box 
<code>JMeter Variable Name</code> should be selected by default</li>
+    <li><bug>61758</bug><code>Apply to:</code> field in Extractors, Assertions 
: When entering a value in <code>JMeter Variable Name</code>, the radio box 
<code>JMeter Variable Name</code> should be selected by default. Contributed by 
Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Functions</h3>
 <ul>
     <li><bug>61561</bug>Function helper dialog should display exception in 
result</li>
-    <li><bug>61738</bug>Function Helper Dialog : Add Copy in Generate and 
clarify labels</li>
+    <li><bug>61738</bug>Function Helper Dialog : Add Copy in Generate and 
clarify labels. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
     <li><bug>61593</bug>Remove Detail, Add, Add from Clipboard, Delete buttons 
in Function Helper GUI</li>
     <li><bug>61724</bug>Add <code>__digest</code> function to provide 
computing of Hashes (SHA-XXX, MDX). Based on a contribution by orimarko at 
gmail.com</li>
     <li><bug>61735</bug>Add <code>__dateTimeConvert</code> function to provide 
date formats conversions. Based on a contribution by orimarko at gmail.com</li>
@@ -136,7 +137,6 @@ Summary
 
 <h3>I18N</h3>
 <ul>
-    <li><bug>61559</bug>Better label/translation/documentation for label 
ignoreFirstLine.displayName for CSV Data Set Config</li>
     <li><bug>61606</bug>Translate button <code>Browse...</code> in some 
elements (which use FileEditor class)</li>
     <li><bug>61747</bug>HTTP(S) Test Script Recorder : add the missing doc to 
"Create transaction after request (ms)"</li>
 </ul>
@@ -198,7 +198,7 @@ Summary
 <h3>Controllers</h3>
 <ul>
     <li><bug>61556</bug>Clarify in documentation performance impacts of ${} 
var usage in IfController and groovy. Contributed by Justin McCartney (be_strew 
at yahoo.co.uk)</li>
-    <li><bug>61713</bug>Test Fragment has option to Change Controller and 
Insert Parent</li>
+    <li><bug>61713</bug>Test Fragment has option to Change Controller and 
Insert Parent. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Listeners</h3>


Reply via email to