jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1749195 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java test/src/org/apache/jmeter/functions/ComponentReferenceFunctionTest.java test/src/org/apache/jmeter/testelement/TestElementTest.java
Date Sun, 19 Jun 2016 19:29:15 GMT
Author: fschumacher
Date: Sun Jun 19 19:29:15 2016
New Revision: 1749195

URL: http://svn.apache.org/viewvc?rev=1749195&view=rev
Log:
Convert from while with iterator to for-loop.
Patch by Graham Russell. Part of github pr #174.

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/ComponentReferenceFunctionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/testelement/TestElementTest.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1749195&r1=1749194&r2=1749195&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Sun Jun 19 19:29:15 2016
@@ -371,9 +371,8 @@ public abstract class HTTPSamplerBase ex
             return true;
         } else {
             boolean noArgumentsHasName = true;
-            PropertyIterator args = getArguments().iterator();
-            while (args.hasNext()) {
-                HTTPArgument arg = (HTTPArgument) args.next().getObjectValue();
+            for (JMeterProperty jMeterProperty : getArguments()) {
+                HTTPArgument arg = (HTTPArgument) jMeterProperty.getObjectValue();
                 if (arg.getName() != null && arg.getName().length() > 0) {
                     noArgumentsHasName = false;
                     break;

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/ComponentReferenceFunctionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/ComponentReferenceFunctionTest.java?rev=1749195&r1=1749194&r2=1749195&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/ComponentReferenceFunctionTest.java
(original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/ComponentReferenceFunctionTest.java
Sun Jun 19 19:29:15 2016
@@ -68,9 +68,7 @@ public class ComponentReferenceFunctionT
      */
     private static Test suiteFunctions() throws Exception {
         TestSuite suite = new TestSuite("Functions");
-        Iterator<Object> iter = JMeterTest.getObjects(Function.class).iterator();
-        while (iter.hasNext()) {
-            Object item = iter.next();
+        for (Object item : JMeterTest.getObjects(Function.class)) {
             if (item.getClass().equals(CompoundVariable.class)) {
                 continue;
             }
@@ -149,9 +147,7 @@ public class ComponentReferenceFunctionT
      * Check that function descriptions are OK
      */
     public void runFunction2() throws Exception {
-        Iterator<?> i = funcItem.getArgumentDesc().iterator();
-        while (i.hasNext()) {
-            Object o = i.next();
+        for (Object o : funcItem.getArgumentDesc()) {
             assertTrue("Description must be a String", o instanceof String);
             assertFalse("Description must not start with [refkey", ((String) o).startsWith("[refkey"));
         }

Modified: jmeter/trunk/test/src/org/apache/jmeter/testelement/TestElementTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/testelement/TestElementTest.java?rev=1749195&r1=1749194&r2=1749195&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/testelement/TestElementTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/testelement/TestElementTest.java Sun Jun 19 19:29:15
2016
@@ -46,9 +46,8 @@ public class TestElementTest extends JMe
      */
     public static Test suite() throws Exception {
         TestSuite suite = new TestSuite("TestElements");
-        Iterator<Object> iter = JMeterTest.getObjects(TestElement.class).iterator();
-        while (iter.hasNext()) {
-            TestElement item = (TestElement) iter.next();
+        for (Object o : JMeterTest.getObjects(TestElement.class)) {
+            TestElement item = (TestElement) o;
             TestSuite ts = new TestSuite(item.getClass().getName());
             ts.addTest(new TestElementTest("runTestElement", item));
             suite.addTest(ts);



Mime
View raw message