jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1648056 - in /jmeter/trunk: src/components/org/apache/jmeter/control/gui/ src/protocol/http/org/apache/jmeter/protocol/http/proxy/ src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ xdocs/
Date Sat, 27 Dec 2014 15:22:01 GMT
Author: pmouawad
Date: Sat Dec 27 15:22:01 2014
New Revision: 1648056

URL: http://svn.apache.org/r1648056
Log:
Bug 57381 - HTTP(S) Test Script Recorder should display an error if Target Controller references
a Recording Controller and no Recording Controller exists
Bugzilla Id: 57381

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/control/gui/TreeNodeWrapper.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/gui/TreeNodeWrapper.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/gui/TreeNodeWrapper.java?rev=1648056&r1=1648055&r2=1648056&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/gui/TreeNodeWrapper.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/gui/TreeNodeWrapper.java Sat Dec
27 15:22:01 2014
@@ -43,4 +43,11 @@ public final class TreeNodeWrapper {
     public String toString() {
         return label;
     }
+
+    /**
+     * @return the label
+     */
+    public String getLabel() {
+        return label;
+    }
 }

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java?rev=1648056&r1=1648055&r2=1648056&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Sat Dec 27 15:22:01 2014
@@ -991,7 +991,7 @@ public class ProxyControl extends Generi
      * @return the tree node for the controller where the proxy must store the
      *         generated samplers.
      */
-    private JMeterTreeNode findTargetControllerNode() {
+    public JMeterTreeNode findTargetControllerNode() {
         JMeterTreeNode myTarget = getTarget();
         if (myTarget != null) {
             return myTarget;

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=1648056&r1=1648055&r2=1648056&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Sat Dec 27 15:22:01 2014
@@ -66,6 +66,7 @@ import org.apache.jmeter.gui.util.Horizo
 import org.apache.jmeter.gui.util.MenuFactory;
 import org.apache.jmeter.gui.util.PowerTableModel;
 import org.apache.jmeter.gui.util.VerticalPanel;
+import org.apache.jmeter.protocol.http.control.RecordingController;
 import org.apache.jmeter.protocol.http.proxy.ProxyControl;
 import org.apache.jmeter.protocol.http.sampler.HTTPSamplerFactory;
 import org.apache.jmeter.testelement.TestElement;
@@ -486,6 +487,17 @@ public class ProxyControlGui extends Log
     private void startProxy() {
         ValueReplacer replacer = GuiPackage.getInstance().getReplacer();
         modifyTestElement(model);
+        TreeNodeWrapper treeNodeWrapper = (TreeNodeWrapper)targetNodesModel.getSelectedItem();
+        if (JMeterUtils.getResString("use_recording_controller").equals(treeNodeWrapper.getLabel()))
{
+            JMeterTreeNode targetNode = model.findTargetControllerNode();
+            if(targetNode == null || !(targetNode.getTestElement() instanceof RecordingController))
{
+                JOptionPane.showMessageDialog(this,
+                        JMeterUtils.getResString("proxy_cl_wrong_target_cl"), // $NON-NLS-1$
+                        JMeterUtils.getResString("error_title"), // $NON-NLS-1$
+                        JOptionPane.ERROR_MESSAGE);
+                return;
+            }
+        }
         // Proxy can take some while to start up; show a wating cursor
         Cursor cursor = getCursor();
         setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1648056&r1=1648055&r2=1648056&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Dec 27 15:22:01 2014
@@ -182,6 +182,7 @@ See  <bugzilla>56357</bugzilla> for deta
 <h3>HTTP Samplers and Test Script Recorder</h3>
 <ul>
 <li><bug>25430</bug>HTTP(S) Test Script Recorder : Make it populate HTTP
Authorisation Manager. Partly based on a patch from Dzmitry Kashlach (dzmitrykashlach at gmail.com)</li>
+<li><bug>57381</bug>HTTP(S) Test Script Recorder should display an error
if Target Controller references a Recording Controller and no Recording Controller exists.
Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Other samplers</h3>



Mime
View raw message