jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1408631 - in /jmeter/trunk/src/components/org/apache/jmeter/control: ForeachController.java gui/ForeachControlPanel.java
Date Tue, 13 Nov 2012 08:05:03 GMT
Author: pmouawad
Date: Tue Nov 13 08:05:02 2012
New Revision: 1408631

URL: http://svn.apache.org/viewvc?rev=1408631&view=rev
Log:
Bug 54131 - ForEach Controller : Add start and end index for looping over variables
Clarify code as per sebb notes.
http://mail-archives.apache.org/mod_mbox/jmeter-dev/201211.mbox/%3CCAOGo0VYLAV2Vc5XYY%2BLeSP9EPr4iVQb%2BqOq1YkVTgrf%2Bveav-Q%40mail.gmail.com%3E
Bugzilla Id: 54131

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java
    jmeter/trunk/src/components/org/apache/jmeter/control/gui/ForeachControlPanel.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java?rev=1408631&r1=1408630&r2=1408631&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java Tue Nov 13
08:05:02 2012
@@ -55,7 +55,7 @@ public class ForeachController extends G
      * @param startIndex Start index  of loop
      */
     public void setStartIndex(String startIndex) {
-        setProperty(START_INDEX, startIndex != null ? startIndex : "", "");
+        setProperty(START_INDEX, startIndex, "");
     }
 
     /**
@@ -77,7 +77,7 @@ public class ForeachController extends G
      * @param endIndex End index  of loop
      */
     public void setEndIndex(String endIndex) {
-        setProperty(END_INDEX, endIndex != null ? endIndex : "", "");
+        setProperty(END_INDEX, endIndex, "");
     }
 
     /**

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/gui/ForeachControlPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ForeachControlPanel.java?rev=1408631&r1=1408630&r2=1408631&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/gui/ForeachControlPanel.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/gui/ForeachControlPanel.java Tue
Nov 13 08:05:02 2012
@@ -135,27 +135,12 @@ public class ForeachControlPanel extends
     public void modifyTestElement(TestElement lc) {
         configureTestElement(lc);
         if (lc instanceof ForeachController) {
-            if (inputVal.getText().length() > 0) {
-                ((ForeachController) lc).setInputVal(inputVal.getText());
-            } else {
-                ((ForeachController) lc).setInputVal(""); // $NON-NLS-1$
-            }
-            if (startIndex.getText().length() > 0) {
-                ((ForeachController) lc).setStartIndex(startIndex.getText());
-            } else {
-                ((ForeachController) lc).setStartIndex(null); // $NON-NLS-1$
-            }
-            if (endIndex.getText().length() > 0) {
-                ((ForeachController) lc).setEndIndex(endIndex.getText());
-            } else {
-                ((ForeachController) lc).setEndIndex(null); // $NON-NLS-1$
-            }
-            if (returnVal.getText().length() > 0) {
-                ((ForeachController) lc).setReturnVal(returnVal.getText());
-            } else {
-                ((ForeachController) lc).setReturnVal(""); // $NON-NLS-1$
-            }
-            ((ForeachController) lc).setUseSeparator(useSeparator.isSelected());
+            ForeachController fec = (ForeachController) lc;
+            fec.setInputVal(inputVal.getText());
+            fec.setStartIndex(startIndex.getText());
+            fec.setEndIndex(endIndex.getText());
+            fec.setReturnVal(returnVal.getText());
+            fec.setUseSeparator(useSeparator.isSelected());
         }
     }
 



Mime
View raw message