diff --git a/delphi-frontend/pom.xml b/delphi-frontend/pom.xml
index e52758ca9..90cf6492e 100644
--- a/delphi-frontend/pom.xml
+++ b/delphi-frontend/pom.xml
@@ -100,6 +100,11 @@
archunit-junit5
test
+
+ com.google.guava
+ guava-testlib
+ test
+
diff --git a/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/DelphiFileStream.java b/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/DelphiFileStream.java
index 7b8a6c986..ad7f924d7 100644
--- a/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/DelphiFileStream.java
+++ b/delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/DelphiFileStream.java
@@ -40,16 +40,7 @@ private String load(String fileName, String encoding) throws IOException {
if (fileName != null) {
File f = new File(fileName);
int size = (int) f.length();
- try (BOMInputStream input =
- new BOMInputStream(
- new FileInputStream(fileName),
- false,
- ByteOrderMark.UTF_8,
- ByteOrderMark.UTF_16LE,
- ByteOrderMark.UTF_16BE,
- ByteOrderMark.UTF_32LE,
- ByteOrderMark.UTF_32BE)) {
-
+ try (BOMInputStream input = bomInputStream(fileName).get()) {
ByteOrderMark bom = input.getBOM();
if (bom != null) {
encoding = bom.getCharsetName();
@@ -76,4 +67,16 @@ public String getSourceName() {
public String getEncoding() {
return this.encoding;
}
+
+ private static BOMInputStream.Builder bomInputStream(String fileName) throws IOException {
+ return BOMInputStream.builder()
+ .setInputStream(new FileInputStream(fileName))
+ .setInclude(false)
+ .setByteOrderMarks(
+ ByteOrderMark.UTF_8,
+ ByteOrderMark.UTF_16LE,
+ ByteOrderMark.UTF_16BE,
+ ByteOrderMark.UTF_32LE,
+ ByteOrderMark.UTF_32BE);
+ }
}
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/msbuild/condition/VersionTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/msbuild/condition/VersionTest.java
index 72367db64..8a05a9d0e 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/msbuild/condition/VersionTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/msbuild/condition/VersionTest.java
@@ -18,65 +18,25 @@
*/
package au.com.integradev.delphi.msbuild.condition;
-import static org.assertj.core.api.Assertions.assertThat;
-
import au.com.integradev.delphi.msbuild.utils.VersionUtils;
-import java.util.stream.Stream;
+import com.google.common.testing.EqualsTester;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtensionContext;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.ArgumentsProvider;
-import org.junit.jupiter.params.provider.ArgumentsSource;
class VersionTest {
- static class EqualVersionArgumentsProvider implements ArgumentsProvider {
- @Override
- public Stream provideArguments(ExtensionContext context) {
- return Stream.of(
- Arguments.of("1.0.0.0", "1.0.0.0"),
- Arguments.of("1.1.0.0", "1.1.0.0"),
- Arguments.of("1.1.1.0", "1.1.1.0"),
- Arguments.of("1.1.1.1", "1.1.1.1"));
- }
- }
-
- static class UnequalVersionArgumentsProvider implements ArgumentsProvider {
- @Override
- public Stream provideArguments(ExtensionContext context) {
- return Stream.of(
- Arguments.of("2.0.0.0", "1.0.0.0"),
- Arguments.of("1.1.0.0", "1.0.0.0"),
- Arguments.of("1.0.1.0", "1.0.0.0"),
- Arguments.of("1.0.0.1", "1.0.0.0"));
- }
- }
-
- @ParameterizedTest(name = "\"{0}\" should be equal to: {1}")
- @ArgumentsSource(EqualVersionArgumentsProvider.class)
- void testEqualVersions(String left, String right) {
- assertThat(VersionUtils.parse(left)).isEqualTo(VersionUtils.parse(right));
- }
-
- @ParameterizedTest(name = "\"{0}\" should not be equal to: {1}")
- @ArgumentsSource(UnequalVersionArgumentsProvider.class)
- void testUnequalVersions(String left, String right) {
- assertThat(VersionUtils.parse(left)).isNotEqualTo(VersionUtils.parse(right));
- }
-
- @Test
- void testEqualToSameInstance() {
- Version version = VersionUtils.parse("1.0.0.0").orElseThrow();
- assertThat(version).isEqualTo(version);
- }
-
@Test
- void testNotEqualToNull() {
- assertThat(VersionUtils.parse("1.0.0.0").orElseThrow()).isNotEqualTo(null);
+ void testEquals() {
+ new EqualsTester()
+ .addEqualityGroup(version("1.0"))
+ .addEqualityGroup(version("1.0.0"))
+ .addEqualityGroup(version("1.0.0.0"))
+ .addEqualityGroup(version("1.1.0.0"))
+ .addEqualityGroup(version("1.1.1.0"))
+ .addEqualityGroup(version("1.1.1.1"))
+ .addEqualityGroup(version("2.0.0.0"))
+ .testEquals();
}
- @Test
- void testNotEqualToUnrelatedObject() {
- assertThat(VersionUtils.parse("1.0.0.0").orElseThrow()).isNotEqualTo(new Object());
+ private static Version version(String input) {
+ return VersionUtils.parse(input).orElseThrow(AssertionError::new);
}
}
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/operator/OperatorIntrinsicTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/operator/OperatorIntrinsicTest.java
index d9124a2d0..725b8d990 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/operator/OperatorIntrinsicTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/operator/OperatorIntrinsicTest.java
@@ -21,6 +21,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import au.com.integradev.delphi.type.parameter.IntrinsicParameter;
+import com.google.common.testing.EqualsTester;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
@@ -58,7 +59,7 @@ void testIsClassInvocable() {
@Test
void testEquals() {
- OperatorIntrinsic equal =
+ OperatorIntrinsic base =
new OperatorIntrinsic("Foo", List.of(TypeFactory.untypedType()), TypeFactory.voidType());
OperatorIntrinsic differentName =
new OperatorIntrinsic("Bar", List.of(TypeFactory.untypedType()), TypeFactory.voidType());
@@ -67,17 +68,11 @@ void testEquals() {
OperatorIntrinsic differentReturnType =
new OperatorIntrinsic("Foo", List.of(TypeFactory.untypedType()), TypeFactory.untypedType());
- assertThat(INTRINSIC)
- .isEqualTo(INTRINSIC)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(equal)
- .hasSameHashCodeAs(equal)
- .isNotEqualTo(differentName)
- .doesNotHaveSameHashCodeAs(differentName)
- .isNotEqualTo(differentParameters)
- .doesNotHaveSameHashCodeAs(differentParameters)
- .isNotEqualTo(differentReturnType)
- .doesNotHaveSameHashCodeAs(differentReturnType);
+ new EqualsTester()
+ .addEqualityGroup(base)
+ .addEqualityGroup(differentName)
+ .addEqualityGroup(differentParameters)
+ .addEqualityGroup(differentReturnType)
+ .testEquals();
}
}
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/EnumElementNameDeclarationTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/EnumElementNameDeclarationTest.java
index f9870a98a..ae3c29bf8 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/EnumElementNameDeclarationTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/EnumElementNameDeclarationTest.java
@@ -31,6 +31,7 @@
import au.com.integradev.delphi.antlr.ast.node.SimpleNameDeclarationNodeImpl;
import au.com.integradev.delphi.file.DelphiFile;
import au.com.integradev.delphi.utils.types.TypeFactoryUtils;
+import com.google.common.testing.EqualsTester;
import org.antlr.runtime.CommonToken;
import org.junit.jupiter.api.Test;
import org.sonar.plugins.communitydelphi.api.symbol.declaration.EnumElementNameDeclaration;
@@ -41,17 +42,18 @@ void testEquals() {
EnumElementNameDeclaration foo = createEnumElement("Foo");
EnumElementNameDeclaration otherFoo = createEnumElement("Foo");
EnumElementNameDeclaration bar = createEnumElement("Bar");
+ EnumElementNameDeclaration baz = createEnumElement("Baz");
+
+ new EqualsTester()
+ .addEqualityGroup(foo, otherFoo)
+ .addEqualityGroup(bar)
+ .addEqualityGroup(baz)
+ .testEquals();
assertThat(foo)
- .isEqualTo(foo)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(otherFoo)
.isEqualByComparingTo(otherFoo)
- .hasSameHashCodeAs(otherFoo)
- .isNotEqualTo(bar)
.isNotEqualByComparingTo(bar)
- .doesNotHaveSameHashCodeAs(bar);
+ .isNotEqualByComparingTo(baz);
}
@Test
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/RoutineNameDeclarationTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/RoutineNameDeclarationTest.java
index 633e34120..5d6545249 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/RoutineNameDeclarationTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/RoutineNameDeclarationTest.java
@@ -24,6 +24,7 @@
import au.com.integradev.delphi.symbol.SymbolicNode;
import au.com.integradev.delphi.type.factory.TypeFactoryImpl;
import au.com.integradev.delphi.utils.types.TypeFactoryUtils;
+import com.google.common.testing.EqualsTester;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -80,7 +81,7 @@ class RoutineNameDeclarationTest {
@Test
void testEquals() {
- RoutineNameDeclaration equals =
+ RoutineNameDeclaration base =
new RoutineNameDeclarationImpl(
LOCATION,
FULLY_QUALIFIED_NAME,
@@ -247,42 +248,31 @@ void testEquals() {
Collections.emptyList(),
ATTRIBUTE_TYPES);
+ new EqualsTester()
+ .addEqualityGroup(ROUTINE, base)
+ .addEqualityGroup(forwardDeclaration)
+ .addEqualityGroup(implementationDeclaration)
+ .addEqualityGroup(differentLocation)
+ .addEqualityGroup(differentFullyQualifiedName)
+ .addEqualityGroup(differentReturnType)
+ .addEqualityGroup(differentDirectives)
+ .addEqualityGroup(differentIsClassInvocable)
+ .addEqualityGroup(differentIsCallable)
+ .addEqualityGroup(differentRoutineType)
+ .addEqualityGroup(differentTypeParameters)
+ .testEquals();
+
assertThat(ROUTINE)
- .isEqualTo(ROUTINE)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(equals)
- .hasSameHashCodeAs(equals)
- .isEqualByComparingTo(equals)
- .isNotEqualTo(forwardDeclaration)
- .doesNotHaveSameHashCodeAs(forwardDeclaration)
+ .isEqualByComparingTo(base)
.isNotEqualByComparingTo(forwardDeclaration)
- .isNotEqualTo(implementationDeclaration)
- .doesNotHaveSameHashCodeAs(implementationDeclaration)
.isNotEqualByComparingTo(implementationDeclaration)
- .isNotEqualTo(differentLocation)
- .doesNotHaveSameHashCodeAs(differentLocation)
.isNotEqualByComparingTo(differentLocation)
- .isNotEqualTo(differentFullyQualifiedName)
- .doesNotHaveSameHashCodeAs(differentFullyQualifiedName)
.isNotEqualByComparingTo(differentFullyQualifiedName)
- .isNotEqualTo(differentReturnType)
- .doesNotHaveSameHashCodeAs(differentReturnType)
.isNotEqualByComparingTo(differentReturnType)
- .isNotEqualTo(differentDirectives)
- .doesNotHaveSameHashCodeAs(differentDirectives)
.isNotEqualByComparingTo(differentDirectives)
- .isNotEqualTo(differentIsClassInvocable)
- .doesNotHaveSameHashCodeAs(differentIsClassInvocable)
.isNotEqualByComparingTo(differentIsClassInvocable)
- .isNotEqualTo(differentIsCallable)
- .doesNotHaveSameHashCodeAs(differentIsCallable)
.isNotEqualByComparingTo(differentIsCallable)
- .isNotEqualTo(differentRoutineType)
- .doesNotHaveSameHashCodeAs(differentRoutineType)
.isNotEqualByComparingTo(differentRoutineType)
- .isNotEqualTo(differentTypeParameters)
- .doesNotHaveSameHashCodeAs(differentTypeParameters)
.isNotEqualByComparingTo(differentTypeParameters);
}
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/TypeParameterNameDeclarationTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/TypeParameterNameDeclarationTest.java
index e212e5c30..f4b63d793 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/TypeParameterNameDeclarationTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/TypeParameterNameDeclarationTest.java
@@ -23,6 +23,7 @@
import au.com.integradev.delphi.antlr.DelphiLexer;
import au.com.integradev.delphi.antlr.ast.node.CommonDelphiNodeImpl;
import au.com.integradev.delphi.type.generic.TypeParameterTypeImpl;
+import com.google.common.testing.EqualsTester;
import org.antlr.runtime.CommonToken;
import org.junit.jupiter.api.Test;
import org.sonar.plugins.communitydelphi.api.symbol.declaration.TypeParameterNameDeclaration;
@@ -38,18 +39,13 @@ void testEquals() {
TypeParameterNameDeclaration fooWithDifferentTypeInstance = createTypeParameter("Foo");
TypeParameterNameDeclaration bar = createTypeParameter("Bar");
- assertThat(foo)
- .isEqualTo(foo)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(otherFoo)
- .isEqualByComparingTo(otherFoo)
- .hasSameHashCodeAs(otherFoo)
- .isNotEqualTo(fooWithDifferentTypeInstance)
- .doesNotHaveSameHashCodeAs(fooWithDifferentTypeInstance)
- .isNotEqualTo(bar)
- .isNotEqualByComparingTo(bar)
- .doesNotHaveSameHashCodeAs(bar);
+ new EqualsTester()
+ .addEqualityGroup(foo, otherFoo)
+ .addEqualityGroup(fooWithDifferentTypeInstance)
+ .addEqualityGroup(bar)
+ .testEquals();
+
+ assertThat(foo).isEqualByComparingTo(otherFoo).isNotEqualByComparingTo(bar);
}
@Test
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitImportNameDeclarationTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitImportNameDeclarationTest.java
index b507b7c5b..28f23972c 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitImportNameDeclarationTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitImportNameDeclarationTest.java
@@ -27,6 +27,7 @@
import au.com.integradev.delphi.antlr.ast.node.QualifiedNameDeclarationNodeImpl;
import au.com.integradev.delphi.antlr.ast.node.UnitImportNodeImpl;
import au.com.integradev.delphi.file.DelphiFile;
+import com.google.common.testing.EqualsTester;
import java.io.File;
import java.nio.file.Path;
import org.antlr.runtime.CommonToken;
@@ -45,17 +46,13 @@ void testEquals() {
UnitImportNameDeclaration differentName = createImport("Bar");
UnitImportNameDeclaration differentOriginalDeclaration = createImport("Foo", createUnit("Foo"));
- assertThat(foo)
- .isEqualTo(foo)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(otherFoo)
- .isEqualByComparingTo(otherFoo)
- .hasSameHashCodeAs(otherFoo)
- .isNotEqualTo(differentName)
- .doesNotHaveSameHashCodeAs(differentName)
- .isNotEqualTo(differentOriginalDeclaration)
- .doesNotHaveSameHashCodeAs(differentOriginalDeclaration);
+ new EqualsTester()
+ .addEqualityGroup(foo, otherFoo)
+ .addEqualityGroup(differentName)
+ .addEqualityGroup(differentOriginalDeclaration)
+ .testEquals();
+
+ assertThat(foo).isEqualByComparingTo(otherFoo).isNotEqualByComparingTo(differentName);
}
@Test
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitNameDeclarationTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitNameDeclarationTest.java
index 8f30ca1a7..79682b494 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitNameDeclarationTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/declaration/UnitNameDeclarationTest.java
@@ -26,6 +26,7 @@
import au.com.integradev.delphi.antlr.ast.node.IdentifierNodeImpl;
import au.com.integradev.delphi.antlr.ast.node.QualifiedNameDeclarationNodeImpl;
import au.com.integradev.delphi.file.DelphiFile;
+import com.google.common.testing.EqualsTester;
import java.io.File;
import java.nio.file.Path;
import org.antlr.runtime.CommonToken;
@@ -42,18 +43,16 @@ void testEquals() {
UnitNameDeclaration fooWithDifferentPath = createUnit("Foo", "/bar/foo.pas");
UnitNameDeclaration bar = createUnit("Bar", "/bar.pas");
+ new EqualsTester()
+ .addEqualityGroup(foo, otherFoo)
+ .addEqualityGroup(fooWithDifferentPath)
+ .addEqualityGroup(bar)
+ .testEquals();
+
assertThat(foo)
- .isEqualTo(foo)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(otherFoo)
- .hasSameHashCodeAs(otherFoo)
- .isNotEqualTo(fooWithDifferentPath)
+ .isEqualByComparingTo(otherFoo)
.isNotEqualByComparingTo(fooWithDifferentPath)
- .doesNotHaveSameHashCodeAs(fooWithDifferentPath)
- .isNotEqualTo(bar)
- .isNotEqualByComparingTo(bar)
- .doesNotHaveSameHashCodeAs(bar);
+ .isNotEqualByComparingTo(bar);
}
@Test
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImplTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImplTest.java
index b8baf9e67..629136593 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImplTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/symbol/occurrence/NameOccurrenceImplTest.java
@@ -22,6 +22,7 @@
import static org.mockito.Mockito.mock;
import au.com.integradev.delphi.symbol.SymbolicNode;
+import com.google.common.testing.EqualsTester;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.sonar.plugins.communitydelphi.api.symbol.NameOccurrence;
@@ -53,32 +54,32 @@ void testIsAttributeReference() {
@Test
void testEquals() {
SymbolicNode foo = SymbolicNode.imaginary("Foo", DelphiScope.unknownScope());
-
NameOccurrence occurrenceA = new NameOccurrenceImpl(foo);
- assertThat(occurrenceA).isEqualTo(occurrenceA).isNotEqualTo(null).isNotEqualTo(new Object());
-
NameOccurrence occurrenceB = new NameOccurrenceImpl(foo);
- assertThat(occurrenceA).isEqualTo(occurrenceB);
SymbolicNode bar = SymbolicNode.imaginary("Bar", DelphiScope.unknownScope());
NameOccurrence occurrenceC = new NameOccurrenceImpl(bar);
- assertThat(occurrenceA).isNotEqualTo(occurrenceC);
NameOccurrenceImpl occurrenceD = new NameOccurrenceImpl(foo);
occurrenceD.setIsExplicitInvocation(true);
- assertThat(occurrenceA).isNotEqualTo(occurrenceD);
NameOccurrenceImpl occurrenceE = new NameOccurrenceImpl(foo);
occurrenceE.setIsGeneric();
- assertThat(occurrenceA).isNotEqualTo(occurrenceE);
NameOccurrenceImpl occurrenceF = new NameOccurrenceImpl(foo);
occurrenceF.setNameDeclaration(mock(NameDeclaration.class));
- assertThat(occurrenceA).isNotEqualTo(occurrenceF);
NameOccurrenceImpl occurrenceG = new NameOccurrenceImpl(foo);
occurrenceG.setTypeArguments(List.of(TypeFactory.unknownType()));
- assertThat(occurrenceA).isNotEqualTo(occurrenceG);
+
+ new EqualsTester()
+ .addEqualityGroup(occurrenceA, occurrenceB)
+ .addEqualityGroup(occurrenceC)
+ .addEqualityGroup(occurrenceD)
+ .addEqualityGroup(occurrenceE)
+ .addEqualityGroup(occurrenceF)
+ .addEqualityGroup(occurrenceG)
+ .testEquals();
}
@Test
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/type/generic/TypeSpecializationContextTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/type/generic/TypeSpecializationContextTest.java
index d3cc62f64..f59f0f8af 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/type/generic/TypeSpecializationContextTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/type/generic/TypeSpecializationContextTest.java
@@ -22,6 +22,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import com.google.common.testing.EqualsTester;
import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
@@ -65,16 +66,10 @@ void testParameterArgumentMismatchProducesInvalidContext() {
@Test
void testEquals() {
- TypeSpecializationContext context =
- new TypeSpecializationContextImpl(mock(NameDeclaration.class), Collections.emptyList());
- TypeSpecializationContext other =
- new TypeSpecializationContextImpl(mock(NameDeclaration.class), Collections.emptyList());
-
- assertThat(context)
- .isEqualTo(context)
- .isNotEqualTo(null)
- .isNotEqualTo(new Object())
- .isEqualTo(other)
- .hasSameHashCodeAs(other);
+ new EqualsTester()
+ .addEqualityGroup(
+ new TypeSpecializationContextImpl(mock(NameDeclaration.class), Collections.emptyList()),
+ new TypeSpecializationContextImpl(mock(NameDeclaration.class), Collections.emptyList()))
+ .testEquals();
}
}
diff --git a/delphi-frontend/src/test/java/au/com/integradev/delphi/type/parameter/ParameterTest.java b/delphi-frontend/src/test/java/au/com/integradev/delphi/type/parameter/ParameterTest.java
index 81924ff6f..efbb6a992 100644
--- a/delphi-frontend/src/test/java/au/com/integradev/delphi/type/parameter/ParameterTest.java
+++ b/delphi-frontend/src/test/java/au/com/integradev/delphi/type/parameter/ParameterTest.java
@@ -24,6 +24,7 @@
import au.com.integradev.delphi.type.generic.TypeParameterTypeImpl;
import au.com.integradev.delphi.type.generic.TypeSpecializationContextImpl;
+import com.google.common.testing.EqualsTester;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.sonar.plugins.communitydelphi.api.ast.FormalParameterNode.FormalParameterData;
@@ -65,13 +66,9 @@ void testEquals() {
Parameter formalParameter = FormalParameter.create(data);
Parameter intrinsicParameter = IntrinsicParameter.create(TYPE_PARAMETER);
- assertThat(formalParameter)
- .isEqualTo(formalParameter)
- .isNotEqualTo(new Object())
- .isNotEqualTo(null)
- .isEqualTo(intrinsicParameter)
- .isEqualByComparingTo(intrinsicParameter)
- .hasSameHashCodeAs(intrinsicParameter);
+ new EqualsTester().addEqualityGroup(formalParameter, intrinsicParameter).testEquals();
+
+ assertThat(formalParameter).isEqualByComparingTo(intrinsicParameter);
}
private static TypeSpecializationContext createSpecializationContext() {
diff --git a/delphi-tokens-generator-maven-plugin/pom.xml b/delphi-tokens-generator-maven-plugin/pom.xml
index 1c5607ce1..3ab8074d2 100644
--- a/delphi-tokens-generator-maven-plugin/pom.xml
+++ b/delphi-tokens-generator-maven-plugin/pom.xml
@@ -41,7 +41,7 @@
org.apache.maven.plugin-tools
maven-plugin-annotations
- 3.7.0
+ 3.15.0
provided
diff --git a/docs/delphi-custom-rules-example/pom.xml b/docs/delphi-custom-rules-example/pom.xml
index 664e16617..b08f0aa2e 100644
--- a/docs/delphi-custom-rules-example/pom.xml
+++ b/docs/delphi-custom-rules-example/pom.xml
@@ -50,15 +50,15 @@
UTF-8
1.9.0
10.1.0.809
- 2.7.0.1482
+ 2.13.0.3004
1.7.30
- 5.9.0
- 3.23.1
- 5.4.0
- 3.12.1
- 0.8.11
- 2.21.1
- 4.3
+ 5.11.0
+ 3.26.3
+ 5.13.0
+ 3.13.0
+ 0.8.12
+ 2.24
+ 4.5
1.23.0.740
3.5.1
diff --git a/license-maven-plugin/pom.xml b/license-maven-plugin/pom.xml
index 7fc8ce3ca..1a47aec19 100644
--- a/license-maven-plugin/pom.xml
+++ b/license-maven-plugin/pom.xml
@@ -41,7 +41,7 @@
org.apache.maven.plugin-tools
maven-plugin-annotations
- 3.7.0
+ 3.15.0
provided
diff --git a/pom.xml b/pom.xml
index 4ddff572e..e235746dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -114,36 +114,36 @@
9.9.0.65466
10.1.0.809
- 2.7.0.1482
- 4.7.1.1872
+ 2.13.0.3004
+ 5.0.0.2065
3.5.3
- 1.10.0
+ 1.12.0
2.0.6.1
- 2.10.1
+ 2.11.0
3.0.2
- 32.1.3-jre
- 3.12.0
- 2.11.0
- 1.14.9
- 5.9.0
- 1.9.0-M1
- 3.23.1
- 5.2.0
- 1.2.0
- 2.20.0
+ 33.3.0-jre
+ 3.17.0
+ 2.17.0
+ 1.15.1
+ 5.11.0
+ 1.11.0
+ 3.26.3
+ 5.13.0
+ 1.3.0
+ 2.32.0
1.7.30
- 3.12.1
- 0.8.11
- 3.2.3
- 3.4.1
+ 3.13.0
+ 0.8.12
+ 3.5.0
+ 3.5.0
1.23.0.740
- 2.41.1
+ 2.43.0
3.5.3
- 3.5.0
+ 3.6.0
1.5.3
3.5.1
- 2.16.2
+ 2.17.1
2.1.1
3.3.0
3.6.3
@@ -274,6 +274,12 @@
${sonar-orchestrator.version}
test
+
+ com.google.guava
+ guava-testlib
+ ${guava.version}
+ test
+
@@ -368,7 +374,7 @@
-XDcompilePolicy=simple
-Werror
-Xlint:all,-serial,-processing,-classfile,-path
- -Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.* -Xep:UnicodeInCode:OFF -Xep:CanIgnoreReturnValueSuggester:OFF -Xep:StringCaseLocaleUsage:OFF
+ -Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.* -Xep:UnicodeInCode:OFF -Xep:CanIgnoreReturnValueSuggester:OFF -Xep:StringCaseLocaleUsage:OFF -Xep:EnumOrdinal:OFF
-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED