You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2020/03/29 20:16:16 UTC

[jmeter] branch master updated (e9b7351 -> 5d8eb28)

This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git.


    from e9b7351  Fix trailing whitespace in XPath2ExtractorGui
     new 7ee1f45  Fix $NON-NLS-1$
     new 0320782  Remove Etched Border
     new 510c92f  Bug 64287 - WhileController: Improve UX
     new 5d8eb28  Bug 64288 - JUnit Request: Improve UX

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jmeter/control/gui/ForeachControlPanel.java    |  2 -
 .../jmeter/control/gui/IfControllerPanel.java      | 22 +++---
 .../jmeter/control/gui/WhileControllerGui.java     | 27 ++-----
 src/protocol/build.gradle.kts                      |  1 +
 .../java/control/gui/JUnitTestSamplerGui.java      | 86 +++++++++++-----------
 xdocs/changes.xml                                  |  2 +
 6 files changed, 63 insertions(+), 77 deletions(-)


[jmeter] 04/04: Bug 64288 - JUnit Request: Improve UX

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 5d8eb28810b30646044f9d6d51ca2a0105b866d5
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Sun Mar 29 22:15:48 2020 +0200

    Bug 64288 - JUnit Request: Improve UX
---
 src/protocol/build.gradle.kts                      |  1 +
 .../java/control/gui/JUnitTestSamplerGui.java      | 86 +++++++++++-----------
 xdocs/changes.xml                                  |  1 +
 3 files changed, 43 insertions(+), 45 deletions(-)

diff --git a/src/protocol/build.gradle.kts b/src/protocol/build.gradle.kts
index f2ddb1c..e622dea 100644
--- a/src/protocol/build.gradle.kts
+++ b/src/protocol/build.gradle.kts
@@ -139,6 +139,7 @@ project("junit") {
         implementation("org.exparity:hamcrest-date") {
             because("hamcrest-date.jar was historically shipped with JMeter")
         }
+        implementation("com.miglayout:miglayout-swing")
     }
 }
 
diff --git a/src/protocol/junit/src/main/java/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java b/src/protocol/junit/src/main/java/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
index b14cb3d..b780038 100644
--- a/src/protocol/junit/src/main/java/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
+++ b/src/protocol/junit/src/main/java/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
@@ -31,13 +31,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
-import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.JTextField;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
 import org.apache.jmeter.gui.TestElementMetadata;
-import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.protocol.java.sampler.JUnitSampler;
 import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jmeter.testelement.TestElement;
@@ -52,6 +51,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import junit.framework.TestCase;
+import net.miginfocom.swing.MigLayout;
 
 /**
  * The <code>JUnitTestSamplerGui</code> class provides the user interface
@@ -92,41 +92,30 @@ implements ChangeListener, ActionListener, ItemListener
         SPATHS = paths;
     }
 
-    private JLabeledTextField constructorLabel =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_constructor_string")); //$NON-NLS-1$
+    private JTextField constructorLabel =
+        new JTextField();
 
-    private JLabel methodLabel =
-        new JLabel(
-            JMeterUtils.getResString("junit_test_method")); //$NON-NLS-1$
+    private JTextField successMsg =
+        new JTextField();
 
-    private JLabeledTextField successMsg =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_success_msg")); //$NON-NLS-1$
+    private JTextField failureMsg =
+        new JTextField();
 
-    private JLabeledTextField failureMsg =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_failure_msg")); //$NON-NLS-1$
-
-    private JLabeledTextField errorMsg =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_error_msg")); //$NON-NLS-1$
+    private JTextField errorMsg =
+        new JTextField();
 
-    private JLabeledTextField successCode =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_success_code")); //$NON-NLS-1$
+    private JTextField successCode =
+        new JTextField();
 
-    private JLabeledTextField failureCode =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_failure_code")); //$NON-NLS-1$
+    private JTextField failureCode =
+        new JTextField();
 
-    private JLabeledTextField errorCode =
-        new JLabeledTextField(
-            JMeterUtils.getResString("junit_error_code")); //$NON-NLS-1$
+    private JTextField errorCode =
+        new JTextField();
 
     private JLabeledTextField filterpkg =
         new JLabeledTextField(
-            JMeterUtils.getResString("junit_pkg_filter")); //$NON-NLS-1$
+            JMeterUtils.getResString("junit_pkg_filter"), 50); //$NON-NLS-1$
 
     private JCheckBox doSetup = new JCheckBox(JMeterUtils.getResString("junit_do_setup_teardown")); //$NON-NLS-1$
     private JCheckBox appendError = new JCheckBox(JMeterUtils.getResString("junit_append_error")); //$NON-NLS-1$
@@ -168,8 +157,6 @@ implements ChangeListener, ActionListener, ItemListener
         setBorder(makeBorder());
 
         add(makeTitlePanel(), BorderLayout.NORTH);
-
-
         add(createClassPanel(), BorderLayout.CENTER);
     }
 
@@ -212,44 +199,53 @@ implements ChangeListener, ActionListener, ItemListener
 
     private JPanel createClassPanel()
     {
-        JLabel label =
-            new JLabel(JMeterUtils.getResString("protocol_java_classname")); //$NON-NLS-1$
-
         classnameCombo = new JComboBox<>();
         classnameCombo.addActionListener(this);
         classnameCombo.setEditable(false);
-        label.setLabelFor(classnameCombo);
 
         methodName = new JComboBox<>();
         methodName.addActionListener(this);
-        methodLabel.setLabelFor(methodName);
-
         setupClasslist(false);
 
-        VerticalPanel panel = new VerticalPanel();
-        panel.add(junit4);
+        JPanel panel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
+        panel.add(junit4, "span 2");
         junit4.addItemListener(this);
-        panel.add(filterpkg);
+
+        panel.add(filterpkg, "span 2");
         filterpkg.addChangeListener(this);
 
-        panel.add(label);
+        panel.add(JMeterUtils.labelFor(classnameCombo, "protocol_java_classname"));
         panel.add(classnameCombo);
 
         constructorLabel.setText("");
+        panel.add(JMeterUtils.labelFor(constructorLabel, "junit_constructor_string"));
         panel.add(constructorLabel);
-        panel.add(methodLabel);
+
+        panel.add(JMeterUtils.labelFor(methodName, "junit_test_method"));
         panel.add(methodName);
 
+        panel.add(JMeterUtils.labelFor(successMsg, "junit_success_msg"));
         panel.add(successMsg);
+
+        panel.add(JMeterUtils.labelFor(successCode, "junit_success_code"));
         panel.add(successCode);
+
+        panel.add(JMeterUtils.labelFor(failureMsg, "junit_failure_msg"));
         panel.add(failureMsg);
+
+        panel.add(JMeterUtils.labelFor(failureCode, "junit_failure_code"));
         panel.add(failureCode);
+
+        panel.add(JMeterUtils.labelFor(errorMsg, "junit_error_msg"));
         panel.add(errorMsg);
+
+        panel.add(JMeterUtils.labelFor(errorCode, "junit_error_code"));
         panel.add(errorCode);
-        panel.add(doSetup);
-        panel.add(appendError);
-        panel.add(appendExc);
-        panel.add(createInstancePerSample);
+
+        panel.add(doSetup, "span 2");
+        panel.add(appendError, "span 2");
+        panel.add(appendExc, "span 2");
+        panel.add(createInstancePerSample, "span 2");
         return panel;
     }
 
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index a3b0f65..12ed808 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -113,6 +113,7 @@ For instance: log viewer, JSR223 code editor were not previously scaled with zoo
 
 <h3>Other samplers</h3>
 <ul>
+    <li><bug>64288</bug>JUnit Request: Improve UX</li>
 </ul>
 
 <h3>Controllers</h3>


[jmeter] 01/04: Fix $NON-NLS-1$

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 7ee1f450d846b82c4ac60bf9cc322ffce98a5dbe
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Sun Mar 29 22:06:06 2020 +0200

    Fix $NON-NLS-1$
---
 .../jmeter/control/gui/IfControllerPanel.java      | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/control/gui/IfControllerPanel.java b/src/core/src/main/java/org/apache/jmeter/control/gui/IfControllerPanel.java
index 0ff9bb2..7419622 100644
--- a/src/core/src/main/java/org/apache/jmeter/control/gui/IfControllerPanel.java
+++ b/src/core/src/main/java/org/apache/jmeter/control/gui/IfControllerPanel.java
@@ -190,23 +190,23 @@ public class IfControllerPanel extends AbstractControllerGui implements ChangeLi
     private JPanel createConditionPanel() {
         JPanel conditionPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
 
-        ImageIcon image = JMeterUtils.getImage("warning.png");
+        ImageIcon image = JMeterUtils.getImage("warning.png"); // $NON-NLS-1$
         warningLabel = new JLabel(JMeterUtils.getResString("if_controller_warning"), image, SwingConstants.LEFT); // $NON-NLS-1$
         JFactory.warning(warningLabel);
-        conditionPanel.add(warningLabel, "span 2");
+        conditionPanel.add(warningLabel, "span 2"); // $NON-NLS-1$
 
         // Condition LABEL
         conditionLabel = new JLabel(JMeterUtils.getResString("if_controller_label")); // $NON-NLS-1$
         conditionPanel.add(conditionLabel);
-        conditionLabel.setName("if_controller_label");
+        conditionLabel.setName("if_controller_label"); // $NON-NLS-1$
 
         // Condition
-        theCondition = JSyntaxTextArea.getInstance(5, 50); // $NON-NLS-1$
+        theCondition = JSyntaxTextArea.getInstance(5, 50);
         conditionLabel.setLabelFor(theCondition);
         conditionPanel.add(JTextScrollPane.getInstance(theCondition));
 
-        JLabel ifControllerTipLabel = new JLabel(JMeterUtils.getResString("if_controller_tip"));
-        useLastSampleStatusButton = new JButton(JMeterUtils.getResString("if_controller_use_last_sample_ok"));
+        JLabel ifControllerTipLabel = new JLabel(JMeterUtils.getResString("if_controller_tip")); // $NON-NLS-1$
+        useLastSampleStatusButton = new JButton(JMeterUtils.getResString("if_controller_use_last_sample_ok")); // $NON-NLS-1$
         useLastSampleStatusButton.setActionCommand(USE_LAST_SAMPLE_OK);
         useLastSampleStatusButton.addActionListener(this);
         conditionPanel.add(useLastSampleStatusButton);
@@ -215,11 +215,11 @@ public class IfControllerPanel extends AbstractControllerGui implements ChangeLi
         // Use expression instead of Javascript
         useExpression = new JCheckBox(JMeterUtils.getResString("if_controller_expression")); // $NON-NLS-1$
         useExpression.addChangeListener(this);
-        conditionPanel.add(useExpression, "span 2");
+        conditionPanel.add(useExpression, "span 2"); // $NON-NLS-1$
 
         // Evaluate All checkbox
         evaluateAll = new JCheckBox(JMeterUtils.getResString("if_controller_evaluate_all")); // $NON-NLS-1$
-        conditionPanel.add(evaluateAll, "span 2");
+        conditionPanel.add(evaluateAll, "span 2"); // $NON-NLS-1$
 
         return conditionPanel;
     }
@@ -230,11 +230,11 @@ public class IfControllerPanel extends AbstractControllerGui implements ChangeLi
             String colorId;
             if(useExpression.isSelected()) {
                 colorId = JMeterUIDefaults.LABEL_WARNING_FOREGROUND;
-                conditionLabel.setText(JMeterUtils.getResString("if_controller_expression_label"));
+                conditionLabel.setText(JMeterUtils.getResString("if_controller_expression_label")); // $NON-NLS-1$
                 useLastSampleStatusButton.setEnabled(true);
             } else {
                 colorId = JMeterUIDefaults.LABEL_ERROR_FOREGROUND;
-                conditionLabel.setText(JMeterUtils.getResString("if_controller_label"));
+                conditionLabel.setText(JMeterUtils.getResString("if_controller_label")); // $NON-NLS-1$
                 useLastSampleStatusButton.setEnabled(false);
             }
             warningLabel.setForeground(UIManager.getColor(colorId));
@@ -249,7 +249,7 @@ public class IfControllerPanel extends AbstractControllerGui implements ChangeLi
     public void actionPerformed(ActionEvent e) {
         String action = e.getActionCommand();
         if (action.equals(USE_LAST_SAMPLE_OK)) {
-            theCondition.setText(theCondition.getText()+"${JMeterThread.last_sample_ok}");
+            theCondition.setText(theCondition.getText()+"${JMeterThread.last_sample_ok}"); // $NON-NLS-1$
         }
     }
 }


[jmeter] 03/04: Bug 64287 - WhileController: Improve UX

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 510c92fe736b29325625e8d3bb0698676e0ffffb
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Sun Mar 29 22:11:17 2020 +0200

    Bug 64287 - WhileController: Improve UX
---
 .../jmeter/control/gui/WhileControllerGui.java     | 27 +++++++---------------
 xdocs/changes.xml                                  |  1 +
 2 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java b/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java
index 2ce6fc4..30921fc 100644
--- a/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java
+++ b/src/core/src/main/java/org/apache/jmeter/control/gui/WhileControllerGui.java
@@ -19,8 +19,6 @@ package org.apache.jmeter.control.gui;
 
 import java.awt.BorderLayout;
 
-import javax.swing.Box;
-import javax.swing.JLabel;
 import javax.swing.JPanel;
 
 import org.apache.jmeter.control.WhileController;
@@ -31,14 +29,14 @@ import org.apache.jmeter.gui.util.JTextScrollPane;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
 
+import net.miginfocom.swing.MigLayout;
+
 @GUIMenuSortOrder(4)
 @TestElementMetadata(labelResource = "while_controller_title")
 public class WhileControllerGui extends AbstractControllerGui {
 
     private static final long serialVersionUID = 240L;
 
-    private static final String CONDITION_LABEL = "while_controller_label"; // $NON-NLS-1$
-
     /**
      * A field allowing the user to specify the condition (not yet used).
      */
@@ -118,11 +116,7 @@ public class WhileControllerGui extends AbstractControllerGui {
         setLayout(new BorderLayout(0, 5));
         setBorder(makeBorder());
         add(makeTitlePanel(), BorderLayout.NORTH);
-
-        JPanel mainPanel = new JPanel(new BorderLayout());
-        mainPanel.add(createConditionPanel(), BorderLayout.NORTH);
-        add(mainPanel, BorderLayout.CENTER);
-
+        add(createConditionPanel(), BorderLayout.CENTER);
     }
 
     /**
@@ -131,20 +125,15 @@ public class WhileControllerGui extends AbstractControllerGui {
      * @return a GUI panel containing the condition components
      */
     private JPanel createConditionPanel() {
-        JPanel conditionPanel = new JPanel(new BorderLayout(5, 0));
-
-        // Condition LABEL
-        JLabel conditionLabel = new JLabel(JMeterUtils.getResString(CONDITION_LABEL));
-        conditionPanel.add(conditionLabel, BorderLayout.WEST);
+        JPanel conditionPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
 
         // Condition
         // This means exit if last sample failed
-        theCondition = JSyntaxTextArea.getInstance(5, 50);  // $NON-NLS-1$
+        theCondition = JSyntaxTextArea.getInstance(5, 50);
+        JTextScrollPane theConditionJSP = JTextScrollPane.getInstance(theCondition);
+        conditionPanel.add(JMeterUtils.labelFor(theConditionJSP, "while_controller_label"));
         theCondition.setName(CONDITION);
-        conditionLabel.setLabelFor(theCondition);
-        conditionPanel.add(JTextScrollPane.getInstance(theCondition), BorderLayout.CENTER);
-
-        conditionPanel.add(Box.createHorizontalGlue(), BorderLayout.NORTH);
+        conditionPanel.add(theConditionJSP);
 
         return conditionPanel;
     }
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 9a7bab0..a3b0f65 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -120,6 +120,7 @@ For instance: log viewer, JSR223 code editor were not previously scaled with zoo
     <li><bug>64277</bug>ForEach Controller: Improve UX</li>
     <li><bug>64280</bug>If Controller: Improve UX</li>
     <li><bug>64282</bug>Throughput Controller: Improve UX</li>
+    <li><bug>64287</bug>WhileController: Improve UX</li>
 </ul>
 
 <h3>Listeners</h3>


[jmeter] 02/04: Remove Etched Border

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 032078205e13a9f5162253b5d5434f11cf363a64
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Sun Mar 29 22:06:24 2020 +0200

    Remove Etched Border
---
 .../main/java/org/apache/jmeter/control/gui/ForeachControlPanel.java    | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/components/src/main/java/org/apache/jmeter/control/gui/ForeachControlPanel.java b/src/components/src/main/java/org/apache/jmeter/control/gui/ForeachControlPanel.java
index 380c28f..c1f5449 100644
--- a/src/components/src/main/java/org/apache/jmeter/control/gui/ForeachControlPanel.java
+++ b/src/components/src/main/java/org/apache/jmeter/control/gui/ForeachControlPanel.java
@@ -19,7 +19,6 @@ package org.apache.jmeter.control.gui;
 
 import java.awt.BorderLayout;
 
-import javax.swing.BorderFactory;
 import javax.swing.JCheckBox;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
@@ -192,7 +191,6 @@ public class ForeachControlPanel extends AbstractControllerGui {
      */
     private JPanel createLoopCountPanel() {
         JPanel loopPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
-        loopPanel.setBorder(BorderFactory.createEtchedBorder()); // $NON-NLS-1$
 
         // TEXT FIELD
         inputVal = new JTextField("", 5); // $NON-NLS-1$