jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1718833 - in /jmeter/trunk/src: components/org/apache/jmeter/visualizers/backend/ core/org/apache/jmeter/save/converters/ core/org/apache/jmeter/testelement/ protocol/http/org/apache/jmeter/protocol/http/proxy/ protocol/http/org/apache/jme...
Date Wed, 09 Dec 2015 12:34:07 GMT
Author: pmouawad
Date: Wed Dec  9 12:34:07 2015
New Revision: 1718833

URL: http://svn.apache.org/viewvc?rev=1718833&view=rev
Log:
#resolve #51

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
Wed Dec  9 12:34:07 2015
@@ -39,7 +39,7 @@ import org.apache.jmeter.config.Argument
 import org.apache.jmeter.config.gui.ArgumentsPanel;
 import org.apache.jmeter.gui.util.HorizontalPanel;
 import org.apache.jmeter.testelement.TestElement;
-import org.apache.jmeter.testelement.property.PropertyIterator;
+import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jmeter.visualizers.gui.AbstractListenerGui;
 import org.apache.jorphan.logging.LoggingManager;
@@ -181,9 +181,8 @@ public class BackendListenerGui extends
                 }
 
                 if (testParams != null) {
-                    PropertyIterator i = testParams.getArguments().iterator();
-                    while (i.hasNext()) {
-                        Argument arg = (Argument) i.next().getObjectValue();
+                    for (JMeterProperty jMeterProperty : testParams.getArguments()) {
+                        Argument arg = (Argument) jMeterProperty.getObjectValue();
                         String name = arg.getName();
                         String value = arg.getValue();
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java
Wed Dec  9 12:34:07 2015
@@ -22,17 +22,16 @@ import org.apache.jmeter.config.ConfigTe
 import org.apache.jmeter.save.SaveService;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.testelement.property.JMeterProperty;
-import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.testelement.property.TestElementProperty;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
 
-import com.thoughtworks.xstream.mapper.Mapper;
 import com.thoughtworks.xstream.converters.MarshallingContext;
 import com.thoughtworks.xstream.converters.UnmarshallingContext;
 import com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter;
 import com.thoughtworks.xstream.io.HierarchicalStreamReader;
 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
+import com.thoughtworks.xstream.mapper.Mapper;
 
 public class TestElementPropertyConverter extends AbstractCollectionConverter {
     private static final Logger log = LoggingManager.getLoggerForClass();
@@ -68,18 +67,17 @@ public class TestElementPropertyConverte
             TestElement te = (TestElement)prop.getObjectValue();
             ConversionHelp.saveSpecialProperties(te,writer);
         }
-        PropertyIterator iter = prop.iterator();
-        while (iter.hasNext()) {
-            JMeterProperty jmp=iter.next();
+        
+        for (JMeterProperty jmp : prop) {
             // Skip special properties if required
             if (!SaveService.IS_TESTPLAN_FORMAT_22 || !ConversionHelp.isSpecialProperty(jmp.getName()))
             {
                 // Don't save empty comments
-                   if (!(TestElement.COMMENTS.equals(jmp.getName())
-                           && jmp.getStringValue().length()==0))
-                   {
+                if (!(TestElement.COMMENTS.equals(jmp.getName())
+                        && jmp.getStringValue().isEmpty()))
+                {
                     writeItem(jmp, context, writer);
-                   }
+                }
             }
         }
         //TODO clazz is probably always the same as testclass

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java Wed Dec 
9 12:34:07 2015
@@ -218,9 +218,8 @@ public abstract class AbstractTestElemen
     }
 
     protected void traverseCollection(CollectionProperty col, TestElementTraverser traverser)
{
-        PropertyIterator iter = col.iterator();
-        while (iter.hasNext()) {
-            traverseProperty(traverser, iter.next());
+        for (JMeterProperty jMeterProperty :  col) {
+            traverseProperty(traverser, jMeterProperty);
         }
     }
 
@@ -539,9 +538,8 @@ public abstract class AbstractTestElemen
         }
         temporaryProperties.add(property);
         if (property instanceof MultiProperty) {
-            PropertyIterator iter = ((MultiProperty) property).iterator();
-            while (iter.hasNext()) {
-                setTemporary(iter.next());
+            for (JMeterProperty jMeterProperty : (MultiProperty) property) {
+                setTemporary(jMeterProperty);
             }
         }
     }

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=1718833&r1=1718832&r2=1718833&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
Wed Dec  9 12:34:07 2015
@@ -1225,9 +1225,8 @@ public class ProxyControl extends Generi
     }
 
     private boolean matchesPatterns(String url, CollectionProperty patterns) {
-        PropertyIterator iter = patterns.iterator();
-        while (iter.hasNext()) {
-            String item = iter.next().getStringValue();
+        for (JMeterProperty jMeterProperty : patterns) {
+            String item = jMeterProperty.getStringValue();
             Pattern pattern = null;
             try {
                 pattern = JMeterUtils.getPatternCache().getPattern(item, Perl5Compiler.READ_ONLY_MASK
| Perl5Compiler.SINGLELINE_MASK);

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
Wed Dec  9 12:34:07 2015
@@ -35,7 +35,6 @@ import org.apache.jmeter.protocol.http.c
 import org.apache.jmeter.protocol.http.util.HTTPConstants;
 import org.apache.jmeter.protocol.http.util.HTTPFileArg;
 import org.apache.jmeter.samplers.Interruptible;
-import org.apache.jmeter.testelement.property.CollectionProperty;
 import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.util.JMeterUtils;
@@ -241,10 +240,8 @@ public class AjpSampler extends HTTPSamp
         setInt(0xA00b); //Host
         setString(host);
         if(headers != null) {
-            CollectionProperty coll = headers.getHeaders();
-            PropertyIterator i = coll.iterator();
-            while(i.hasNext()) {
-                Header header = (Header)i.next().getObjectValue();
+            for (JMeterProperty jMeterProperty : headers.getHeaders()) {
+                Header header = (Header) jMeterProperty.getObjectValue();
                 String n = header.getName();
                 String v = header.getValue();
                 hbuf.append(n).append(COLON_SPACE).append(v).append(NEWLINE);
@@ -331,10 +328,8 @@ public class AjpSampler extends HTTPSamp
         String cookieHeader = null;
         if(cookies != null) {
             cookieHeader = cookies.getCookieHeaderForURL(url);
-            CollectionProperty coll = cookies.getCookies();
-            PropertyIterator i = coll.iterator();
-            while(i.hasNext()) {
-                Cookie cookie = (Cookie)(i.next().getObjectValue());
+            for (JMeterProperty jMeterProperty : cookies.getCookies()) {
+                Cookie cookie = (Cookie)(jMeterProperty.getObjectValue());
                 setInt(0xA009); // Cookie
                 setString(cookie.getName()+"="+cookie.getValue());//$NON-NLS-1$
             }

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
Wed Dec  9 12:34:07 2015
@@ -78,6 +78,7 @@ import org.apache.jmeter.protocol.http.u
 import org.apache.jmeter.protocol.http.util.SlowHttpClientSocketFactory;
 import org.apache.jmeter.services.FileServer;
 import org.apache.jmeter.testelement.property.CollectionProperty;
+import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jmeter.util.JsseSSLManager;
@@ -623,11 +624,10 @@ public class HTTPHC3Impl extends HTTPHCA
         if (headerManager != null) {
             CollectionProperty headers = headerManager.getHeaders();
             if (headers != null) {
-                PropertyIterator i = headers.iterator();
-                while (i.hasNext()) {
+                for (JMeterProperty jMeterProperty : headers) {
                     org.apache.jmeter.protocol.http.control.Header header
                     = (org.apache.jmeter.protocol.http.control.Header)
-                       i.next().getObjectValue();
+                            jMeterProperty.getObjectValue();
                     String n = header.getName();
                     // Don't allow override of Content-Length
                     // This helps with SoapSampler hack too

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Wed Dec  9 12:34:07 2015
@@ -118,6 +118,7 @@ import org.apache.jmeter.protocol.http.u
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.services.FileServer;
 import org.apache.jmeter.testelement.property.CollectionProperty;
+import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jmeter.util.JsseSSLManager;
@@ -867,11 +868,10 @@ public class HTTPHC4Impl extends HTTPHCA
         if (headerManager != null) {
             CollectionProperty headers = headerManager.getHeaders();
             if (headers != null) {
-                PropertyIterator i = headers.iterator();
-                while (i.hasNext()) {
+                for (JMeterProperty jMeterProperty : headers) {
                     org.apache.jmeter.protocol.http.control.Header header
                     = (org.apache.jmeter.protocol.http.control.Header)
-                       i.next().getObjectValue();
+                            jMeterProperty.getObjectValue();
                     String n = header.getName();
                     // Don't allow override of Content-Length
                     // TODO - what other headers are not allowed?

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java?rev=1718833&r1=1718832&r2=1718833&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java
Wed Dec  9 12:34:07 2015
@@ -40,7 +40,7 @@ import org.apache.jmeter.protocol.http.c
 import org.apache.jmeter.protocol.http.util.HTTPConstants;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.testelement.property.CollectionProperty;
-import org.apache.jmeter.testelement.property.PropertyIterator;
+import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jmeter.util.SSLManager;
 import org.apache.jorphan.logging.LoggingManager;
@@ -360,9 +360,8 @@ public class HTTPJavaImpl extends HTTPAb
         if (headerManager != null) {
             CollectionProperty headers = headerManager.getHeaders();
             if (headers != null) {
-                PropertyIterator i = headers.iterator();
-                while (i.hasNext()) {
-                    Header header = (Header) i.next().getObjectValue();
+                for (JMeterProperty jMeterProperty : headers) {
+                    Header header = (Header) jMeterProperty.getObjectValue();
                     String n = header.getName();
                     String v = header.getValue();
                     conn.addRequestProperty(n, v);



Mime
View raw message