You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2019/09/30 21:15:23 UTC

[jmeter] branch master updated (105a399 -> 178f633)

This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git.


    from 105a399  This commit fixes bugs 63614 and 63723 Bug 63614 - Distributed testing: Unable to generate Dashboard report at end of load test
     new dbcd39f  Fix security warning by Sonar
     new ed9f62c  Fix sonar warning : Make field private
     new 3110a88  Fix SONAR warning :Check delete result
     new 5dc63d8  Sonar security Warning: False positives in the context of performance and pen testing which is what JMeter is made for
     new 8576798  Sonar security Warning: False positive
     new 3c0ed9f  Fix Sonar warning: Replace printStackTrace by logging
     new 178f633  Fix Sonar warning: Make field private

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/jmeter/reporters/MailerModel.java    |  3 +++
 .../src/main/java/org/apache/jmeter/gui/MainFrame.java   |  2 +-
 .../jmeter/report/processor/ExternalSampleSorter.java    |  4 +++-
 .../jmeter/report/processor/SampleWriterConsumer.java    |  4 +++-
 .../org/apache/jmeter/util/CustomX509TrustManager.java   |  5 +++--
 .../org/apache/jmeter/util/TrustAllSSLSocketFactory.java | 16 ++++++++--------
 .../src/main/java/test/DummyAnnotatedTest.java           |  2 +-
 .../src/main/java/woolfel/DummyTestCase.java             | 13 ++++++++-----
 .../smtp/sampler/protocol/TrustAllSSLSocketFactory.java  |  6 ++----
 .../protocol/mongodb/sampler/MongoScriptSampler.java     |  2 +-
 10 files changed, 33 insertions(+), 24 deletions(-)


[jmeter] 07/07: Fix Sonar warning: Make field private

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 178f63385f49001b098e2c8166c203b91d24189d
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:14:47 2019 +0200

    Fix Sonar warning: Make field private
---
 src/protocol/junit-sample/src/main/java/test/DummyAnnotatedTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/protocol/junit-sample/src/main/java/test/DummyAnnotatedTest.java b/src/protocol/junit-sample/src/main/java/test/DummyAnnotatedTest.java
index 278ab42..83f935c 100644
--- a/src/protocol/junit-sample/src/main/java/test/DummyAnnotatedTest.java
+++ b/src/protocol/junit-sample/src/main/java/test/DummyAnnotatedTest.java
@@ -33,7 +33,7 @@ import org.junit.Test;
  */
 public class DummyAnnotatedTest
 {
-    public int two = 1; //very wrong.
+    private int two = 1; //very wrong.
 
     public DummyAnnotatedTest() {
     }


[jmeter] 03/07: Fix SONAR warning :Check delete result

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 3110a885036297e01b2aac98f62a0854cdefc6b8
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:11:04 2019 +0200

    Fix SONAR warning :Check delete result
---
 .../java/org/apache/jmeter/report/processor/ExternalSampleSorter.java | 4 +++-
 .../java/org/apache/jmeter/report/processor/SampleWriterConsumer.java | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/report/processor/ExternalSampleSorter.java b/src/core/src/main/java/org/apache/jmeter/report/processor/ExternalSampleSorter.java
index 0b52913..d5530aa 100644
--- a/src/core/src/main/java/org/apache/jmeter/report/processor/ExternalSampleSorter.java
+++ b/src/core/src/main/java/org/apache/jmeter/report/processor/ExternalSampleSorter.java
@@ -320,7 +320,9 @@ public class ExternalSampleSorter extends AbstractSampleConsumer {
         if (this.pool != null) {
             this.pool.shutdown();
         }
-        getWorkingDirectory().delete();
+        if (!getWorkingDirectory().delete()) {
+            LOG.warn("Was not able to delete folder {}", getWorkingDirectory());
+        }
     }
 
     private File sortAndDump(final List<Sample> samples,
diff --git a/src/core/src/main/java/org/apache/jmeter/report/processor/SampleWriterConsumer.java b/src/core/src/main/java/org/apache/jmeter/report/processor/SampleWriterConsumer.java
index 6046345..b343e8d 100644
--- a/src/core/src/main/java/org/apache/jmeter/report/processor/SampleWriterConsumer.java
+++ b/src/core/src/main/java/org/apache/jmeter/report/processor/SampleWriterConsumer.java
@@ -117,6 +117,8 @@ public class SampleWriterConsumer extends AbstractSampleConsumer {
         for (int i = 0; i < channelsCount; i++) {
             csvWriters[i].close();
         }
-        getWorkingDirectory().delete();
+        if (!getWorkingDirectory().delete()) {
+            LOG.warn("Was not able to delete folder {}", getWorkingDirectory());
+        }
     }
 }


[jmeter] 01/07: Fix security warning by Sonar

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit dbcd39f61a5775d8e676a6504ba6014318354f05
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:10:31 2019 +0200

    Fix security warning by Sonar
---
 .../src/main/java/org/apache/jmeter/reporters/MailerModel.java         | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/components/src/main/java/org/apache/jmeter/reporters/MailerModel.java b/src/components/src/main/java/org/apache/jmeter/reporters/MailerModel.java
index f2f3ffd..8d35e0c 100644
--- a/src/components/src/main/java/org/apache/jmeter/reporters/MailerModel.java
+++ b/src/components/src/main/java/org/apache/jmeter/reporters/MailerModel.java
@@ -110,6 +110,8 @@ public class MailerModel extends AbstractTestElement implements Serializable {
 
     private static final String DEFAULT_LOGIN_VALUE = ""; //$NON-NLS-1$
 
+    private static final String MAIL_SMTP_CHECK_SERVER_IDENTITY = "mail.smtp.ssl.checkserveridentity"; //$NON-NLS-1$
+
     /** The listener for changes. */
     private transient ChangeListener changeListener;
 
@@ -347,6 +349,7 @@ public class MailerModel extends AbstractTestElement implements Serializable {
                 case SSL:
                     props.put(MAIL_SMTP_SOCKETFACTORY_CLASS,
                             "javax.net.ssl.SSLSocketFactory");
+                    props.put(MAIL_SMTP_CHECK_SERVER_IDENTITY, true);
                     break;
                 case TLS:
                     props.put(MAIL_SMTP_STARTTLS,


[jmeter] 06/07: Fix Sonar warning: Replace printStackTrace by logging

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 3c0ed9f02256609c03a3248e5cb42dbce2eacdca
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:13:45 2019 +0200

    Fix Sonar warning: Replace printStackTrace by logging
---
 .../junit-sample/src/main/java/woolfel/DummyTestCase.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java b/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java
index 2523c6b..246e514 100644
--- a/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java
+++ b/src/protocol/junit-sample/src/main/java/woolfel/DummyTestCase.java
@@ -20,10 +20,13 @@ package woolfel;
 
 import java.util.concurrent.TimeUnit;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import junit.framework.TestCase;
 
 public class DummyTestCase extends TestCase {
-
+    private static final Logger LOGGER = LoggerFactory.getLogger(DummyTestCase.class);
     public DummyTestCase() {
         super();
         System.out.println("public DummyTestCase()");
@@ -49,7 +52,7 @@ public class DummyTestCase extends TestCase {
             TimeUnit.MILLISECONDS.sleep(100);
             assertEquals(10,10);
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOGGER.warn("Exception on sleep", e);
         }
     }
 
@@ -58,7 +61,7 @@ public class DummyTestCase extends TestCase {
             TimeUnit.MILLISECONDS.sleep(100);
             assertEquals("one","one");
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOGGER.warn("Exception on sleep", e);
         }
     }
 
@@ -67,7 +70,7 @@ public class DummyTestCase extends TestCase {
             TimeUnit.MILLISECONDS.sleep(100);
             assertEquals(20,10);
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOGGER.warn("Exception on sleep", e);
         }
     }
 
@@ -76,7 +79,7 @@ public class DummyTestCase extends TestCase {
             TimeUnit.MILLISECONDS.sleep(100);
             assertEquals("one","two");
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOGGER.warn("Exception on sleep", e);
         }
     }
 


[jmeter] 05/07: Sonar security Warning: False positive

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 8576798fc18b30c09cf3abc58129181446b42a22
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:12:56 2019 +0200

    Sonar security Warning: False positive
---
 .../org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSampler.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/protocol/mongodb/src/main/java/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSampler.java b/src/protocol/mongodb/src/main/java/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSampler.java
index 9da2e61..924c917 100644
--- a/src/protocol/mongodb/src/main/java/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSampler.java
+++ b/src/protocol/mongodb/src/main/java/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptSampler.java
@@ -44,7 +44,7 @@ public class MongoScriptSampler
 
     public final static String DATABASE = "MongoScriptSampler.database"; //$NON-NLS-1$
     public final static String USERNAME = "MongoScriptSampler.username"; //$NON-NLS-1$
-    public final static String PASSWORD = "MongoScriptSampler.password"; //$NON-NLS-1$
+    public final static String PASSWORD = "MongoScriptSampler.password"; //$NON-NLS-1$ NOSONAR It's not a password
     public final static String SCRIPT = "MongoScriptSampler.script"; //$NON-NLS-1$
 
 


[jmeter] 04/07: Sonar security Warning: False positives in the context of performance and pen testing which is what JMeter is made for

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 5dc63d8cdd2062bb043846c84226d5ff891440d0
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:12:36 2019 +0200

    Sonar security Warning: False positives in the context of performance
    and pen testing which is what JMeter is made for
---
 .../org/apache/jmeter/util/CustomX509TrustManager.java   |  5 +++--
 .../org/apache/jmeter/util/TrustAllSSLSocketFactory.java | 16 ++++++++--------
 .../smtp/sampler/protocol/TrustAllSSLSocketFactory.java  |  6 ++----
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/util/CustomX509TrustManager.java b/src/core/src/main/java/org/apache/jmeter/util/CustomX509TrustManager.java
index 31795e1..4258e8a 100644
--- a/src/core/src/main/java/org/apache/jmeter/util/CustomX509TrustManager.java
+++ b/src/core/src/main/java/org/apache/jmeter/util/CustomX509TrustManager.java
@@ -53,7 +53,7 @@ public class CustomX509TrustManager implements X509TrustManager
      * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String)
      */
     @Override
-    public void checkClientTrusted(X509Certificate[] certificates, String authType) {
+    public void checkClientTrusted(X509Certificate[] certificates, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
         if (log.isDebugEnabled() && certificates != null) {
             for (int i = 0; i < certificates.length; i++) {
                 X509Certificate cert = certificates[i];
@@ -78,7 +78,8 @@ public class CustomX509TrustManager implements X509TrustManager
      * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String)
      */
     @Override
-    public void checkServerTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+    public void checkServerTrusted(X509Certificate[] certificates,String authType) // NOSONAR JMeter is a pentest and perf testing tool
+            throws CertificateException {
         if (log.isDebugEnabled() && certificates != null) {
             for (int i = 0; i < certificates.length; i++) {
                 X509Certificate cert = certificates[i];
diff --git a/src/core/src/main/java/org/apache/jmeter/util/TrustAllSSLSocketFactory.java b/src/core/src/main/java/org/apache/jmeter/util/TrustAllSSLSocketFactory.java
index 66841dc..16e52ab 100644
--- a/src/core/src/main/java/org/apache/jmeter/util/TrustAllSSLSocketFactory.java
+++ b/src/core/src/main/java/org/apache/jmeter/util/TrustAllSSLSocketFactory.java
@@ -35,7 +35,7 @@ import javax.net.ssl.X509ExtendedTrustManager;
  * This class can be used as a SocketFactory with SSL-connections.<p>
  * Its purpose is to ensure that all certificates - no matter from which CA - are accepted to secure the SSL-connection.
  */
-public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
+public class TrustAllSSLSocketFactory extends SSLSocketFactory  { // NOSONAR JMeter is a pentest and perf testing tool
 
     private final SSLSocketFactory factory;
 
@@ -56,11 +56,11 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
                             return EMPTY_X509Certificate;
                         }
                         @Override
-                        public void checkClientTrusted(X509Certificate[] chain, String authType) {
+                        public void checkClientTrusted(X509Certificate[] chain, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
                             // NOOP
                         }
                         @Override
-                        public void checkServerTrusted(X509Certificate[] chain, String authType) {
+                        public void checkServerTrusted(X509Certificate[] chain, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
                             // NOOP
                         }
                         @Override
@@ -115,7 +115,7 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
     @Override
     public Socket createSocket(InetAddress address, int port,
             InetAddress localAddress, int localPort) throws IOException {
-        return factory.createSocket(address, port, localAddress, localPort);
+        return factory.createSocket(address, port, localAddress, localPort); // NOSONAR JMeter is a pentest and perf testing tool
     }
 
     /**
@@ -124,7 +124,7 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
     @Override
     public Socket createSocket(InetAddress address, int port) throws
             IOException {
-        return factory.createSocket(address, port);
+        return factory.createSocket(address, port); // NOSONAR JMeter is a pentest and perf testing tool
     }
 
     /**
@@ -133,7 +133,7 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
     @Override
     public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
     throws IOException {
-        return factory.createSocket(host, port, localHost, localPort);
+        return factory.createSocket(host, port, localHost, localPort); // NOSONAR JMeter is a pentest and perf testing tool
     }
 
     /**
@@ -141,7 +141,7 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
      */
     @Override
     public Socket createSocket(String host, int port) throws IOException {
-        return factory.createSocket(host, port);
+        return factory.createSocket(host, port); // NOSONAR JMeter is a pentest and perf testing tool
     }
 
     /**
@@ -149,7 +149,7 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
      */
     @Override
     public Socket createSocket() throws IOException {
-        return factory.createSocket();
+        return factory.createSocket(); // NOSONAR JMeter is a pentest and perf testing tool
     }
 
     /**
diff --git a/src/protocol/mail/src/main/java/org/apache/jmeter/protocol/smtp/sampler/protocol/TrustAllSSLSocketFactory.java b/src/protocol/mail/src/main/java/org/apache/jmeter/protocol/smtp/sampler/protocol/TrustAllSSLSocketFactory.java
index 9d22e5f..f65ba69 100644
--- a/src/protocol/mail/src/main/java/org/apache/jmeter/protocol/smtp/sampler/protocol/TrustAllSSLSocketFactory.java
+++ b/src/protocol/mail/src/main/java/org/apache/jmeter/protocol/smtp/sampler/protocol/TrustAllSSLSocketFactory.java
@@ -56,12 +56,10 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory  {
                             return EMPTY_X509Certificate;
                         }
                         @Override
-                        public void checkClientTrusted(
-                                X509Certificate[] certs, String authType) {
+                        public void checkClientTrusted(X509Certificate[] certs, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
                         }
                         @Override
-                        public void checkServerTrusted(
-                                X509Certificate[] certs, String authType) {
+                        public void checkServerTrusted(X509Certificate[] certs, String authType) { // NOSONAR JMeter is a pentest and perf testing tool
                         }
                     }
                 },


[jmeter] 02/07: Fix sonar warning : Make field private

Posted by pm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit ed9f62c6ad4fc702537c0e67e4688fa69c1bcb48
Author: pmouawad <p....@ubik-ingenierie.com>
AuthorDate: Mon Sep 30 23:10:45 2019 +0200

    Fix sonar warning : Make field private
---
 src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java b/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java
index 6c15f90..f09758a 100644
--- a/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java
+++ b/src/core/src/main/java/org/apache/jmeter/gui/MainFrame.java
@@ -181,7 +181,7 @@ public class MainFrame extends JFrame implements TestStateListener, Remoteable,
     private javax.swing.Timer computeTestDurationTimer = new javax.swing.Timer(1000,
             this::computeTestDuration);
 
-    public AtomicInteger errorOrFatal = new AtomicInteger(0);
+    private AtomicInteger errorOrFatal = new AtomicInteger(0);
 
     private javax.swing.Timer refreshErrorsTimer = new javax.swing.Timer(1000,
             this::refreshErrors);