jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimirsitni...@apache.org
Subject [jmeter] branch master updated: Verify Template#equals/hashCode with EqualsVerifier
Date Thu, 26 Sep 2019 21:48:10 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 826e332  Verify Template#equals/hashCode with EqualsVerifier
826e332 is described below

commit 826e332eb5440d983e0f44f6a5894961da12e1ba
Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
AuthorDate: Fri Sep 27 00:47:58 2019 +0300

    Verify Template#equals/hashCode with EqualsVerifier
---
 checksum.xml                                                 |  1 +
 gradle.properties                                            |  1 +
 src/bom/build.gradle.kts                                     |  1 +
 src/components/build.gradle.kts                              |  1 +
 .../jmeter/gui/action/template/TestTemplateManager.java      | 12 ++++++++++++
 5 files changed, 16 insertions(+)

diff --git a/checksum.xml b/checksum.xml
index c4e534c..1ce666f 100644
--- a/checksum.xml
+++ b/checksum.xml
@@ -60,6 +60,7 @@
     <trusted-key id='d4012dda1f1f0f82' group='net.sf.jtidy' />
     <trusted-key id='1d185615d0a84648' group='net.sf.saxon' />
     <trusted-key id='098a31f381819057' group='net.sourceforge.nekohtml' />
+    <trusted-key id='4a1bac7f1e3b89b3' group='nl.jqno.equalsverifier' />
     <trusted-key id='c84125c13bf6f2f2' group='org.ajoberstar.grgit' />
     <trusted-key id='6b1b008864323b92' group='org.antlr' />
     <trusted-key id='411063a3a0ffd119' group='org.apache-extras.beanshell' />
diff --git a/gradle.properties b/gradle.properties
index 6fb1973..dc0ce37 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -53,6 +53,7 @@ commons-text.version=1.6
 darcula.version=e208efb96f70e4be9dc362fbb46f6e181ef501dd
 dec.version=0.1.2
 dnsjava.version=2.1.8
+equalsverifier.version=3.1.9
 freemarker.version=2.3.28
 ftplet-api.version=1.1.1
 ftpserver-core.version=1.1.1
diff --git a/src/bom/build.gradle.kts b/src/bom/build.gradle.kts
index 6702fe2..91dac35 100644
--- a/src/bom/build.gradle.kts
+++ b/src/bom/build.gradle.kts
@@ -92,6 +92,7 @@ dependencies {
         apiv("net.minidev:json-smart")
         apiv("net.sf.jtidy:jtidy")
         apiv("net.sf.saxon:Saxon-HE")
+        apiv("nl.jqno.equalsverifier:equalsverifier")
         apiv("org.apache-extras.beanshell:bsh")
         apiv("org.apache.commons:commons-dbcp2")
         apiv("org.apache.commons:commons-jexl3")
diff --git a/src/components/build.gradle.kts b/src/components/build.gradle.kts
index 5f00902..eebc4ed 100644
--- a/src/components/build.gradle.kts
+++ b/src/components/build.gradle.kts
@@ -70,6 +70,7 @@ dependencies {
     testRuntimeOnly("org.bouncycastle:bcmail-jdk15on")
     testRuntimeOnly("org.bouncycastle:bcpkix-jdk15on")
     testRuntimeOnly("org.bouncycastle:bcprov-jdk15on")
+    testImplementation("nl.jqno.equalsverifier:equalsverifier")
 }
 
 fun String?.toBool(nullAs: Boolean, blankAs: Boolean, default: Boolean) =
diff --git a/src/components/src/test/java/org/apache/jmeter/gui/action/template/TestTemplateManager.java
b/src/components/src/test/java/org/apache/jmeter/gui/action/template/TestTemplateManager.java
index 10edf0e..3ad3443 100644
--- a/src/components/src/test/java/org/apache/jmeter/gui/action/template/TestTemplateManager.java
+++ b/src/components/src/test/java/org/apache/jmeter/gui/action/template/TestTemplateManager.java
@@ -38,6 +38,9 @@ import org.junit.Test;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
 public class TestTemplateManager extends JMeterTestCase {
 
     private Map<String, Template> templateMap;
@@ -103,6 +106,15 @@ public class TestTemplateManager extends JMeterTestCase {
     }
 
     @Test
+    public void equalsHashCode() {
+        EqualsVerifier.forClass(Template.class)
+                .usingGetClass()
+                .suppress(Warning.NONFINAL_FIELDS)
+                .suppress(Warning.TRANSIENT_FIELDS)
+                .verify();
+    }
+
+    @Test
     public void testDifferentTemplatesAreNotEqual() {
         Template testTemplate1 = templateMap.get("testTemplateWithParameters");
         Template testTemplate2 = templateMap.get("testTemplateNotTestPlan");


Mime
View raw message