You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+32-3
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,42 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
- Jump to [version 4.x](#4.x)
8
9
- Jump to [version 3.x](#3.x)
9
10
- Jump to [version 2.x](#2.x)
10
11
- Jump to [version 1.x](#1.x)
11
12
12
-
<aname="3.x"/>
13
+
<aname="4.x"/>
13
14
14
15
## [Unreleased]
15
16
17
+
If you're upgrading from EqualsVerifier 3.x, please see the [migration guide](http://jqno.nl/equalsverifier/migration3to4).
18
+
19
+
### Added
20
+
21
+
- Mockito integration: if Mockito is on the classpath or modulepath, EqualsVerifier will use it to instantiate values. This reduces the need for providing prefab values. If Mockito is not available, or if `EqualsVerifier.set(Mode.skipMockito())` is used, EqualsVerifier will fall back to its previous behaviour.
22
+
-`forExamples(T red, T blue)` as an alternative to `forClass()` or `forPackage()`. Give it two instances of a type, and it will test that type using the values already present in the fields of the instances. This way, you don't have to use `withPrefabValues` anymore.
23
+
- Prefab value for `java.util.HexFormat`. ([Issue 981](https://github.com/jqno/equalsverifier/issues/981))
24
+
25
+
### Changed
26
+
27
+
- EqualsVerifier now requires Java 17.
28
+
- EqualsVerifier is now properly modularized according to the JPMS.
29
+
- When using EqualsVerifier as a module, it's no longer needed to `requires net.bytebuddy` (this is now a proper transitive requirement).
30
+
- Improved error message when ClassCastException is encountered.
31
+
32
+
### Removed
33
+
34
+
- Built-in prefab values for Google Guava, Joda-Time and Javafx.
35
+
-`#withResetCaches()`, which was deprecated since version 3.16.2.
36
+
-`Warning.ZERO_FIELDS`, which was deprecated since version 3.17.
37
+
-`forPackage(String packageName, boolean scanRecursively)`, which was deprecated since version 3.19.
38
+
-`forPackage(String packageName, Class<?> mustExtend)`, which was deprecated since version 3.19.
39
+
-`forPackage(...).except(Class<?>... types)`, which was deprecated since version 3.19.
40
+
-`forPackage(...).except(Predicate<Class<?>>... exclusionPredicate)`, which was deprecated since version 3.19.
41
+
42
+
<aname="3.x"/>
43
+
16
44
## [3.19.4] - 2025-04-30
17
45
18
46
### Fixed
@@ -42,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
42
70
43
71
- Bug in `withPrefabValueForField` where in some cases the prefab value is not used.
44
72
73
+
<aname="ScanOption"/>
45
74
## [3.19] - 2025-02-06
46
75
47
76
### Added
@@ -671,7 +700,7 @@ If you're upgrading from EqualsVerifier 2.x, please see the [migration guide](ht
671
700
### Added
672
701
673
702
- Full support for Java 11. ([Issue 197](https://github.com/jqno/equalsverifier/issues/197))
674
-
- Re-usable EqualsVerifier configurations: see [the manual](http://jqno.nl/equalsverifier/manual/reusing-configurations).
703
+
- Re-usable EqualsVerifier configurations: see [the manual](http://jqno.nl/equalsverifier/manual/several-classes-at-once).
675
704
-`#report()` method to ask EqualsVerifier for a report, instead of making it fail a test.
676
705
-`#withGenericPrefabValues()` method added to supply values for specific generic types: see [here](http://jqno.nl/equalsverifier/errormessages/recursive-datastructure#generics).
677
706
@@ -1329,7 +1358,7 @@ Please don't use version 1.3; [it's a broken release](https://jqno.nl/post/2013/
1329
1358
1330
1359
### Added
1331
1360
1332
-
-`#withRelaxedEqualExamples()` to verify equality rules that are more relaxed than simple field-by-field comparisons. ([Issue 9](https://github.com/jqno/equalsverifier/issues/9))
1361
+
-`#forRelaxedEqualExamples()` to verify equality rules that are more relaxed than simple field-by-field comparisons. ([Issue 9](https://github.com/jqno/equalsverifier/issues/9))
|`modules-jdk8`| JDK 8 up to but not including 11 | Build only the modules that are compatible with Java 8 and up. |
81
-
|`modules-jdk11`| JDK 11 up to but not including 16 | Build only the modules that are compatible with Java 11 and up. |
82
-
|`modules-jdk16`| JDK 16 | Build only the modules that are compatible with Java 16 and up. |
83
-
|`modules-jdk17`| JDK 17 and up | Build all modules and build releaseable artifacts. |
84
-
|`static-analysis`| JDK 17 and up, _and_`disableStaticAnalysis` property must be off | Run static analysis checks. This only happens on a recent JDK. Can be disabled by running `mvn verify -DdisableStaticAnalysis`|
85
-
|`release-verification`| JDK 17 and up, _and_`disableReleaseVerification` property must be off | Run release verification checks. This only happens on a recent JDK. Can be disabled by running `mvn verify -DdisableReleaseVerification`|
86
-
|`argline-preview`|`preview` property must be on | Enable Java preview features. Can be activated by running `mvn verify -Dpreview`|
87
-
|`argline-experimental`|`experimental` property must be on | Enables ByteBuddy experimental features; useful for testing EqualsVerifier on Early Access JDK builds. Can be activated by running `mvn verify -Dexperimental`|
88
-
|`pitest`|`pitest` property must be on | Used by PITest integration on GitHub. Can be activated by running `mvn verify -Dpitest`|
|`modules-jdk17`| JDK 17 up to 20 | Build all modules and build releasable artifacts. |
81
+
|`modules-jdk21`| JDK 21 and up | Build all modules and build releasable artifacts. |
82
+
|`static-analysis`|`disableStaticAnalysis` property must be off | Run static analysis checks. This only happens on a recent JDK. Can be disabled by running `mvn verify -DdisableStaticAnalysis`. |
83
+
|`static-analysis-checkstyle`| - | Run Checkstyle checks, for Checkstyle's regression CI. |
84
+
|`argline-preview`|`preview` property must be on | Enable Java preview features. Can be activated by running `mvn verify -Dpreview`. |
85
+
|`argline-experimental`|`experimental` property must be on | Enables ByteBuddy experimental features; useful for testing EqualsVerifier on Early Access JDK builds. Can be activated by running `mvn verify -Dexperimental`|
86
+
|`pitest`|`pitest` property must be on | Used by PITest integration on GitHub. Can be activated by running `mvn verify -Dpitest`. |
87
+
|`modules-jdk21-without-pitest`| JDK 21 and up, _and_`pitest` property must be off | Like `modules-jdk21`, but with additional verifications that are incompatible with PITest. |
89
88
90
89
## Formatting
91
90
@@ -101,15 +100,16 @@ Here's a description of the modules:
| equalsverifier-release-main | release assembly for jar with dependencies |
110
111
| equalsverifier-release-nodep | release assembly for fat jar (with dependencies shaded in) |
111
112
| equalsverifier-release-verify | validation tests for the releases |
112
-
| equalsverifier-test-kotlin | tests for Kotlin classes |
113
113
114
114
## Signed JAR
115
115
@@ -129,10 +129,10 @@ The signed JAR itself can be found in [this repo](https://github.com/jqno/equals
129
129
130
130
To generate the website
131
131
132
-
-Using Docker: start the server by running `docker-compose up` or `docker compose run jekyll serve`.
133
-
-Using Jekyll: install the Ruby 3.x toolchain and run `bundle exec jekyll serve --watch`
132
+
- Using Docker: start the server by running `docker-compose up` or `docker compose run jekyll serve`.
133
+
- Using Jekyll: install the Ruby 3.x toolchain and run `bundle exec jekyll serve --watch`
134
134
135
-
Note that thepage uses the [TilburgsAns](https://www.tilburgsans.nl/) font but references it from the main site at [jqno.nl](https://jqno.nl). In development, it will fall back to a `sans-serif` font. See the font license [here](assets/tilburgsans/Ans%20Font%20License-AFL.pdf).
135
+
Note that the page uses the [TilburgsAns](https://www.tilburgsans.nl/) font but references it from the main site at [jqno.nl](https://jqno.nl). In development, it will fall back to a `sans-serif` font. See the font license [here](assets/tilburgsans/Ans%20Font%20License-AFL.pdf).
Copy file name to clipboardExpand all lines: docs/_manual/14-jpms.md
+3-6
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
title: "The Java Platform Module System"
3
3
permalink: /manual/jpms/
4
4
---
5
-
EqualsVerifier is compatible with the Java Platform Module System (JPMS). However, since it does some reflection, you have to open up some packages. Perhaps you have already done so, as test frameworks like JUnit also require this.
5
+
EqualsVerifier supports the Java Platform Module System (JPMS). However, since it does some reflection, you have to open up some packages. Perhaps you have already done so, as test frameworks like JUnit also require this.
6
6
7
-
The recommended approach is to put a `module-info.java` file in your `src/test/java` folder, that copies the content the `module-info.java` file in `src/main/java`. Let's say this is your `src/main/java/module-info.java`:
7
+
The recommended approach is to put a `module-info.java` file in your `src/test/java` folder, that mirrors the content the `module-info.java` file in `src/main/java`. Let's say this is your `src/main/java/module-info.java`:
8
8
9
9
{% highlight java %}
10
10
module my.module {
@@ -20,7 +20,6 @@ open module my.module { // Note: open
20
20
21
21
requires org.junit.jupiter.api; // For JUnit
22
22
requires nl.jqno.equalsverifier; // For EqualsVerifier
23
-
requires net.bytebuddy; // Dependency of EqualsVerifier
24
23
}
25
24
{% endhighlight %}
26
25
@@ -33,12 +32,9 @@ module my.module {
33
32
34
33
requires org.junit.jupiter.api;
35
34
requires nl.jqno.equalsverifier;
36
-
requires net.bytebuddy;
37
35
}
38
36
{% endhighlight %}
39
37
40
-
Note that the line `requires net.bytebuddy` is not necessary if you use the uberjar dependency `equalsverifier-nodep`.
41
-
42
38
Note that if you do this, and you have model classes or dependencies for model classes in other packages, you will have to open these packages as well, or provide prefab values for these dependencies:
43
39
44
40
{% highlight java %}
@@ -59,3 +55,4 @@ If the class is accessible, but the class for one of its fields isn't, you will
59
55
Field foo of type Bar is not accessible via the Java Module System.
60
56
Consider opening the module that contains it, or add prefab values for type Bar.
61
57
58
+
In those cases, you need to open up their package in `module-info.java` or provide prefab values, as discussed above.
0 commit comments