Skip to content

Commit

Permalink
Reverts back to version 3.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Dec 4, 2024
1 parent 489677a commit d1c00ba
Show file tree
Hide file tree
Showing 98 changed files with 900 additions and 1,942 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void succeed_whenRecordValidatesInput_givenValidPrefabValues() {
}

@Test
public void succeed_whenRecordHasBoundedWildcardGeneric() {
public void succeed_whenRecord() {
EqualsVerifier.forClass(WildcardGenericRecordContainer.class).verify();
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.jqno.equalsverifier.internal.reflection.vintage.mutation;
package nl.jqno.equalsverifier.internal.reflection.vintage;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
package nl.jqno.equalsverifier.internal.reflection.vintage.mutation;
package nl.jqno.equalsverifier.internal.reflection.vintage;

import static nl.jqno.equalsverifier.internal.reflection.vintage.prefabvalues.factories.Factories.values;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotSame;

import java.lang.reflect.Constructor;
import java.util.LinkedHashSet;
import nl.jqno.equalsverifier.internal.reflection.FactoryCache;
import nl.jqno.equalsverifier.internal.reflection.JavaApiPrefabValues;
import nl.jqno.equalsverifier.internal.reflection.TypeTag;
import nl.jqno.equalsverifier.internal.reflection.instantiation.CachedValueProvider;
import nl.jqno.equalsverifier.internal.reflection.instantiation.ValueProvider.Attributes;
import nl.jqno.equalsverifier.internal.reflection.vintage.FactoryCache;
import nl.jqno.equalsverifier.internal.reflection.vintage.VintageValueProvider;
import nl.jqno.equalsverifier.internal.testhelpers.TestValueProviders;
import nl.jqno.equalsverifier.internal.reflection.instantiation.VintageValueProvider;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.objenesis.ObjenesisStd;

public class RecordObjectAccessorScramblingTest {

private static final Attributes EMPTY_ATTRIBUTES = Attributes.unlabeled();
private CachedValueProvider cache;
private static final LinkedHashSet<TypeTag> EMPTY_TYPE_STACK = new LinkedHashSet<>();
private FactoryCache factoryCache;
private VintageValueProvider valueProvider;

@BeforeEach
public void setup() throws Exception {
cache = new CachedValueProvider();
factoryCache = JavaApiPrefabValues.build();
valueProvider =
new VintageValueProvider(
TestValueProviders.empty(),
cache,
factoryCache,
new ObjenesisStd()
);
valueProvider = new VintageValueProvider(factoryCache, new ObjenesisStd());
}

@Test
Expand Down Expand Up @@ -67,7 +57,7 @@ private <T> RecordObjectAccessor<T> create(T object) {
}

private ObjectAccessor<Object> doScramble(Object object) {
return create(object).scramble(valueProvider, TypeTag.NULL, EMPTY_ATTRIBUTES);
return create(object).scramble(valueProvider, TypeTag.NULL, EMPTY_TYPE_STACK);
}

record Point(int x, int y) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
package nl.jqno.equalsverifier.internal.reflection.vintage.mutation;
package nl.jqno.equalsverifier.internal.reflection.vintage;

import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.lang.reflect.Constructor;
import java.util.LinkedHashSet;
import java.util.Objects;
import nl.jqno.equalsverifier.internal.exceptions.ReflectionException;
import nl.jqno.equalsverifier.internal.reflection.Instantiator;
import nl.jqno.equalsverifier.internal.reflection.JavaApiPrefabValues;
import nl.jqno.equalsverifier.internal.reflection.TypeTag;
import nl.jqno.equalsverifier.internal.reflection.instantiation.CachedValueProvider;
import nl.jqno.equalsverifier.internal.reflection.instantiation.ValueProvider.Attributes;
import nl.jqno.equalsverifier.internal.reflection.vintage.VintageValueProvider;
import nl.jqno.equalsverifier.internal.reflection.instantiation.VintageValueProvider;
import nl.jqno.equalsverifier.internal.testhelpers.ExpectedException;
import nl.jqno.equalsverifier.internal.testhelpers.TestValueProviders;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.objenesis.Objenesis;
import org.objenesis.ObjenesisStd;

public class RecordObjectAccessorTest {

private static final Attributes EMPTY_ATTRIBUTES = Attributes.unlabeled();
private static final LinkedHashSet<TypeTag> EMPTY_TYPE_STACK = new LinkedHashSet<>();
private Objenesis objenesis;
private Object recordInstance;

Expand Down Expand Up @@ -76,14 +74,9 @@ public void fail_whenConstructorThrowsOnSomethingElse() {
.of(OtherThrowingConstructorRecord.class, objenesis)
.instantiate();

VintageValueProvider vp = new VintageValueProvider(
TestValueProviders.empty(),
new CachedValueProvider(),
JavaApiPrefabValues.build(),
objenesis
);
VintageValueProvider vp = new VintageValueProvider(JavaApiPrefabValues.build(), objenesis);
ExpectedException
.when(() -> accessorFor(instance).scramble(vp, TypeTag.NULL, EMPTY_ATTRIBUTES))
.when(() -> accessorFor(instance).scramble(vp, TypeTag.NULL, EMPTY_TYPE_STACK))
.assertThrows(ReflectionException.class)
.assertMessageContains("Record:", "failed to run constructor", "prefab values");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import org.junit.jupiter.api.Test;

public class ClassProbeSealedTest {
public class ClassAccessorSealedTest {

@Test
public void isNotSealed() {
Expand Down

This file was deleted.

14 changes: 8 additions & 6 deletions equalsverifier-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
<version>${version.bytebuddy}</version>
</dependency>

<!-- Provided dependencies -->
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>${version.spotbugs}</version>
<scope>provided</scope>
</dependency>

<!-- Shared test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -105,12 +113,6 @@
<version>${version.commons-lang3}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>${version.spotbugs}</version>
<scope>test</scope>
</dependency>

<!-- Third party dependencies that should be supported -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import nl.jqno.equalsverifier.api.EqualsVerifierApi;
import nl.jqno.equalsverifier.api.MultipleTypeEqualsVerifierApi;
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
import nl.jqno.equalsverifier.internal.reflection.FactoryCache;
import nl.jqno.equalsverifier.internal.reflection.PackageScanner;
import nl.jqno.equalsverifier.internal.reflection.vintage.FactoryCache;
import nl.jqno.equalsverifier.internal.reflection.vintage.PrefabValuesApi;
import nl.jqno.equalsverifier.internal.util.ListBuilders;
import nl.jqno.equalsverifier.internal.util.PrefabValuesApi;
import nl.jqno.equalsverifier.internal.util.Validations;
import org.objenesis.Objenesis;
import org.objenesis.ObjenesisStd;
Expand Down Expand Up @@ -51,7 +51,7 @@ private ConfiguredEqualsVerifier(
public ConfiguredEqualsVerifier copy() {
return new ConfiguredEqualsVerifier(
EnumSet.copyOf(warningsToSuppress),
factoryCache.copy(),
new FactoryCache().merge(factoryCache),
usingGetClass,
fieldnameToGetter
);
Expand Down Expand Up @@ -127,7 +127,7 @@ public <T> SingleTypeEqualsVerifierApi<T> forClass(Class<T> type) {
return new SingleTypeEqualsVerifierApi<>(
type,
EnumSet.copyOf(warningsToSuppress),
factoryCache.copy(),
factoryCache,
objenesis,
usingGetClass,
fieldnameToGetter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nl.jqno.equalsverifier;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi;
import nl.jqno.equalsverifier.internal.SuppressFBWarnings;

/**
* Contains the results of an {@link nl.jqno.equalsverifier.EqualsVerifier} run.
Expand Down
Loading

0 comments on commit d1c00ba

Please sign in to comment.