jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1849663 - in /jmeter/trunk: src/core/org/apache/jmeter/engine/ClientJMeterEngine.java src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java xdocs/changes.xml
Date Sun, 23 Dec 2018 21:04:42 GMT
Author: pmouawad
Date: Sun Dec 23 21:04:42 2018
New Revision: 1849663

URL: http://svn.apache.org/viewvc?rev=1849663&view=rev
Log:
Bug 63034 - ClientJMeterEngine: Make rsetProperties use HashMap<String,String> instead
of Properties
Bugzilla Id: 63034

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java
    jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java
    jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java?rev=1849663&r1=1849662&r2=1849663&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java Sun Dec 23 21:04:42
2018
@@ -25,7 +25,9 @@ import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.rmi.server.RemoteObject;
+import java.util.HashMap;
 import java.util.Properties;
+import java.util.stream.Collectors;
 
 import org.apache.jmeter.rmi.RmiUtils;
 import org.apache.jmeter.services.FileServer;
@@ -157,7 +159,7 @@ public class ClientJMeterEngine implemen
             log.info("Sending properties {}", savep);
             try {
                 methodName="rsetProperties()";// NOSONAR Used for tracing
-                remote.rsetProperties(savep);
+                remote.rsetProperties(toHashMapOfString(savep));
             } catch (RemoteException e) {
                 log.warn("Could not set properties: {}, error:{}", savep, e.getMessage(),
e);
             }
@@ -175,6 +177,13 @@ public class ClientJMeterEngine implemen
         }
     }
 
+    private static final HashMap<String, String> toHashMapOfString(Properties properties)
{
+        return new HashMap<>(
+                properties.entrySet().stream().collect(Collectors.toMap(
+                        e -> e.getKey().toString(), 
+                        e -> e.getValue().toString())));
+    }
+
     /**
      * Tidy up RMI access to allow JMeter client to exit.
      * Currently just interrupts the "RMI Reaper" thread.

Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java?rev=1849663&r1=1849662&r2=1849663&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngine.java Sun Dec 23 21:04:42
2018
@@ -21,7 +21,7 @@ package org.apache.jmeter.engine;
 import java.io.File;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
-import java.util.Properties;
+import java.util.HashMap;
 
 import org.apache.jorphan.collections.HashTree;
 
@@ -37,7 +37,7 @@ public interface RemoteJMeterEngine exte
 
     void rreset() throws RemoteException;
 
-    void rsetProperties(Properties p) throws RemoteException;
+    void rsetProperties(HashMap<String,String> p) throws RemoteException;
 
     void rexit() throws RemoteException;
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java?rev=1849663&r1=1849662&r2=1849663&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java Sun Dec 23
21:04:42 2018
@@ -25,6 +25,7 @@ import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.rmi.server.ServerNotActiveException;
+import java.util.HashMap;
 import java.util.Properties;
 
 import org.apache.jmeter.rmi.RmiUtils;
@@ -212,7 +213,7 @@ public final class RemoteJMeterEngineImp
     }
 
     @Override
-    public void rsetProperties(Properties p) throws RemoteException {
+    public void rsetProperties(HashMap<String, String> map) throws RemoteException
{ // NOSONAR
         checkOwner("setProperties");
         if(remotelySetProperties != null) {
             Properties jmeterProperties = JMeterUtils.getJMeterProperties();
@@ -221,8 +222,10 @@ public final class RemoteJMeterEngineImp
                 jmeterProperties.remove(key);
             }
         }
-        backingEngine.setProperties(p);
-        this.remotelySetProperties = p;
+        Properties props = new Properties();
+        props.putAll(map);
+        backingEngine.setProperties(props);
+        this.remotelySetProperties = props;
     }
 
     /**

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1849663&r1=1849662&r2=1849663&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun Dec 23 21:04:42 2018
@@ -71,6 +71,7 @@ Summary
 
 <li>In <code>Response Time Percentiles Over Time (successful responses)</code>
graph of the HTML report, before this version, percentile computation of each time slot used
the percentile data
 of previous time slot as a base. Starting with this version, each time slot is independant.
See <bugzilla>62883</bugzilla></li>
+<li><code>ClientJMeterEngine#rsetProperties</code> signature has been changed
to use <code>HashMap&lt;String,String&gt;</code> instead of Properties,
see <bugzilla>63034</bugzilla></li>
 
 <!-- =================== Improvements =================== -->
 
@@ -153,6 +154,7 @@ of previous time slot as a base. Startin
     <li><bug>62893</bug>Use StringEscapeUtils from commons-text (version
1.6) instead of the deprecated ones from commons-lang3.</li>
     <li>Update to ActiveMQ 5.15.7 (from 5.5.16)</li>
     <li><bug>62972</bug><pr>435</pr>Replace calls to deprecated
method <code>Class#newInstance</code>.</li>
+    <li><bug>63034</bug>ClientJMeterEngine: Make rsetProperties use <code>HashMap&lt;String,String&gt;</code>
instead of Properties</li>
 </ul>
 
  <!-- =================== Bug fixes =================== -->



Mime
View raw message