From cafa758e9f8b4d813b4be3d525309417db78dfb6 Mon Sep 17 00:00:00 2001 From: Michael Schnell <1856319+michael-schnell@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:56:25 +0100 Subject: [PATCH] Java 17 and JUnit5 (#9) * Updated Maven Wrapper * Migrated to Junit5 and cleanup * Changed to Java 17 --- .github/workflows/maven.yml | 4 +- .mvn/wrapper/maven-wrapper.properties | 2 +- README.md | 5 +- pom.xml | 82 ++++++++++--------- .../common/ConstraintViolationException.java | 4 +- .../org/fuin/objects4j/common/Contract.java | 10 +-- .../org/fuin/objects4j/common/FileExists.java | 12 +-- .../objects4j/common/FileExistsValidator.java | 4 +- .../org/fuin/objects4j/common/Immutable.java | 6 +- .../fuin/objects4j/common/IsDirectory.java | 12 +-- .../common/IsDirectoryValidator.java | 4 +- .../org/fuin/objects4j/common/IsFile.java | 12 +-- .../objects4j/common/IsFileValidator.java | 4 +- .../org/fuin/objects4j/common/NeverEmpty.java | 6 +- .../org/fuin/objects4j/common/NeverNull.java | 6 +- .../org/fuin/objects4j/common/NotEmpty.java | 16 ++-- .../fuin/objects4j/common/NotThreadSafe.java | 6 +- .../org/fuin/objects4j/common/Nullable.java | 10 +-- .../org/fuin/objects4j/common/ThreadSafe.java | 6 +- .../fuin/objects4j/ui/AnnotationAnalyzer.java | 19 ++--- .../org/fuin/objects4j/ui/ClassTextInfo.java | 1 - .../org/fuin/objects4j/ui/FieldTextInfo.java | 5 +- .../java/org/fuin/objects4j/ui/FontSize.java | 7 +- .../fuin/objects4j/ui/TableColumnInfo.java | 11 ++- .../org/fuin/objects4j/ui/TextFieldInfo.java | 7 +- .../org/fuin/objects4j/vo/CurrencyAmount.java | 11 ++- .../objects4j/vo/CurrencyAmountConverter.java | 5 +- .../fuin/objects4j/vo/CurrencyAmountStr.java | 8 +- .../vo/CurrencyAmountStrValidator.java | 5 +- .../fuin/objects4j/vo/CurrencyConverter.java | 5 +- .../org/fuin/objects4j/vo/CurrencyStr.java | 8 +- .../objects4j/vo/CurrencyStrValidator.java | 7 +- .../java/org/fuin/objects4j/vo/DateStr.java | 8 +- .../fuin/objects4j/vo/DateStrValidator.java | 6 +- .../org/fuin/objects4j/vo/DayOfTheWeek.java | 13 ++- .../objects4j/vo/DayOfTheWeekConverter.java | 1 - .../fuin/objects4j/vo/DayOfTheWeekStr.java | 8 +- .../fuin/objects4j/vo/DayOpeningHours.java | 9 +- .../vo/DayOpeningHoursConverter.java | 1 - .../fuin/objects4j/vo/DayOpeningHoursStr.java | 8 +- .../org/fuin/objects4j/vo/EmailAddress.java | 1 - .../objects4j/vo/EmailAddressConverter.java | 1 - .../fuin/objects4j/vo/EmailAddressStr.java | 8 +- .../vo/EmailAddressStrValidator.java | 1 - src/main/java/org/fuin/objects4j/vo/Hour.java | 5 +- .../org/fuin/objects4j/vo/HourConverter.java | 1 - .../java/org/fuin/objects4j/vo/HourRange.java | 9 +- .../fuin/objects4j/vo/HourRangeConverter.java | 1 - .../org/fuin/objects4j/vo/HourRangeStr.java | 8 +- .../org/fuin/objects4j/vo/HourRanges.java | 10 +-- .../objects4j/vo/HourRangesConverter.java | 1 - .../org/fuin/objects4j/vo/HourRangesStr.java | 8 +- .../java/org/fuin/objects4j/vo/HourStr.java | 8 +- .../java/org/fuin/objects4j/vo/KeyValue.java | 9 +- .../fuin/objects4j/vo/LocaleConverter.java | 7 +- .../java/org/fuin/objects4j/vo/LocaleStr.java | 8 +- .../fuin/objects4j/vo/LocaleStrValidator.java | 7 +- .../fuin/objects4j/vo/MultiDayOfTheWeek.java | 9 +- .../vo/MultiDayOfTheWeekConverter.java | 1 - .../objects4j/vo/MultiDayOfTheWeekStr.java | 8 +- .../java/org/fuin/objects4j/vo/Password.java | 1 - .../fuin/objects4j/vo/PasswordConverter.java | 1 - .../org/fuin/objects4j/vo/PasswordSha512.java | 7 +- .../objects4j/vo/PasswordSha512Converter.java | 1 - .../fuin/objects4j/vo/PasswordSha512Str.java | 8 +- .../vo/PasswordSha512StrValidator.java | 5 +- .../org/fuin/objects4j/vo/PasswordStr.java | 8 +- .../objects4j/vo/PasswordStrValidator.java | 1 - .../fuin/objects4j/vo/PropertiesContain.java | 8 +- .../vo/PropertiesContainValidator.java | 6 +- .../org/fuin/objects4j/vo/SecurityToken.java | 7 +- .../fuin/objects4j/vo/TrimmedNotEmpty.java | 12 +-- .../vo/TrimmedNotEmptyValidator.java | 1 - .../org/fuin/objects4j/vo/UUIDConverter.java | 5 +- .../java/org/fuin/objects4j/vo/UUIDStr.java | 8 +- .../fuin/objects4j/vo/UUIDStrValidator.java | 5 +- .../java/org/fuin/objects4j/vo/UserName.java | 1 - .../fuin/objects4j/vo/UserNameConverter.java | 1 - .../org/fuin/objects4j/vo/UserNameStr.java | 8 +- .../objects4j/vo/UserNameStrValidator.java | 5 +- .../vo/ValueObjectStringConverter.java | 1 - .../fuin/objects4j/vo/WeeklyOpeningHours.java | 11 +-- .../vo/WeeklyOpeningHoursConverter.java | 1 - .../objects4j/vo/WeeklyOpeningHoursStr.java | 8 +- .../org/fuin/objects4j/vo/package-info.java | 6 +- src/test/java/my/test/MyClass.java | 10 +-- .../java/my/test/MyPasswordContainer.java | 1 - .../java/org/fuin/objects4j/BaseTest.java | 6 +- .../ConstraintViolationExceptionTest.java | 11 ++- .../fuin/objects4j/common/ContractTest.java | 35 ++++---- .../common/FileExistsValidatorTest.java | 18 ++-- .../common/IsDirectoryValidatorTest.java | 18 ++-- .../objects4j/common/IsFileValidatorTest.java | 18 ++-- .../common/UniquelyNumberedExceptionTest.java | 4 +- .../objects4j/ui/AnnotationAnalyzerTest.java | 4 +- .../fuin/objects4j/ui/ClassTextInfoTest.java | 9 +- .../fuin/objects4j/ui/FieldTextInfoTest.java | 44 ++++------ .../org/fuin/objects4j/ui/FontSizeTest.java | 6 +- .../objects4j/ui/TableColumnInfoTest.java | 21 +++-- .../fuin/objects4j/ui/TextFieldInfoTest.java | 7 +- .../org/fuin/objects4j/ui/UsageExamples.java | 4 +- .../vo/AbstractIntegerValueObjectTest.java | 3 +- .../vo/AbstractLongValueObjectTest.java | 3 +- .../vo/AbstractStringValueObjectTest.java | 3 +- .../vo/AbstractUuidValueObjectTest.java | 5 +- .../java/org/fuin/objects4j/vo/AnyStr.java | 3 +- .../vo/CurrencyAmountConverterTest.java | 46 +++++------ .../vo/CurrencyAmountParentEntity.java | 9 +- .../vo/CurrencyAmountStrValidatorTest.java | 12 +-- .../fuin/objects4j/vo/CurrencyAmountTest.java | 21 ++--- .../objects4j/vo/CurrencyConverterTest.java | 34 ++++---- .../objects4j/vo/CurrencyParentEntity.java | 8 +- .../vo/CurrencyStrValidatorTest.java | 12 +-- .../org/fuin/objects4j/vo/CurrencyTest.java | 9 +- src/test/java/org/fuin/objects4j/vo/Data.java | 6 +- .../objects4j/vo/DateStrValidatorTest.java | 16 ++-- .../vo/DayOfTheWeekConverterTest.java | 32 ++++---- .../vo/DayOfTheWeekStrValidatorTest.java | 12 +-- .../fuin/objects4j/vo/DayOfTheWeekTest.java | 17 ++-- .../vo/DayOpeningHoursConverterTest.java | 32 ++++---- .../vo/DayOpeningHoursStrValidatorTest.java | 12 +-- .../objects4j/vo/DayOpeningHoursTest.java | 25 +++--- .../vo/EmailAddressConverterTest.java | 30 ++++--- .../vo/EmailAddressStrValidatorTest.java | 20 ++--- .../fuin/objects4j/vo/EmailAddressTest.java | 21 +++-- .../fuin/objects4j/vo/HourConverterTest.java | 32 ++++---- .../objects4j/vo/HourRangeConverterTest.java | 32 ++++---- .../vo/HourRangeStrValidatorTest.java | 12 +-- .../org/fuin/objects4j/vo/HourRangeTest.java | 29 ++++--- .../objects4j/vo/HourRangesConverterTest.java | 32 ++++---- .../vo/HourRangesStrValidatorTest.java | 12 +-- .../org/fuin/objects4j/vo/HourRangesTest.java | 29 ++++--- .../objects4j/vo/HourStrValidatorTest.java | 12 +-- .../java/org/fuin/objects4j/vo/HourTest.java | 21 +++-- .../org/fuin/objects4j/vo/JsonbHelper.java | 3 +- .../org/fuin/objects4j/vo/KeyValueTest.java | 6 +- .../objects4j/vo/LocaleConverterTest.java | 6 +- .../fuin/objects4j/vo/LocaleParentEntity.java | 4 +- .../objects4j/vo/LocaleStrValidatorTest.java | 27 +++--- .../objects4j/vo/MinutesBitSetBuilder.java | 4 +- .../vo/MultiDayOfTheWeekConverterTest.java | 32 ++++---- .../vo/MultiDayOfTheWeekStrValidatorTest.java | 12 +-- .../objects4j/vo/MultiDayOfTheWeekTest.java | 19 ++--- .../objects4j/vo/PasswordConverterTest.java | 37 ++++----- .../vo/PasswordSha512ConverterTest.java | 37 ++++----- .../vo/PasswordSha512StrValidatorTest.java | 12 +-- .../fuin/objects4j/vo/PasswordSha512Test.java | 31 ++++--- .../vo/PasswordStrValidatorTest.java | 12 +-- .../org/fuin/objects4j/vo/PasswordTest.java | 27 +++--- .../vo/PropertiesContainValidatorTest.java | 16 ++-- .../fuin/objects4j/vo/SecurityTokenTest.java | 4 +- .../vo/TrimmedNotEmptyValidatorTest.java | 20 ++--- .../fuin/objects4j/vo/UUIDConverterTest.java | 6 +- .../fuin/objects4j/vo/UUIDParentEntity.java | 12 +-- .../objects4j/vo/UUIDStrValidatorTest.java | 22 ++--- .../objects4j/vo/UserNameConverterTest.java | 37 ++++----- .../vo/UserNameStrValidatorTest.java | 12 +-- .../org/fuin/objects4j/vo/UserNameTest.java | 57 ++++++++----- .../vo/ValueObjectStringConverterTest.java | 24 +++--- .../vo/WeeklyOpeningHoursConverterTest.java | 32 ++++---- .../WeeklyOpeningHoursStrValidatorTest.java | 12 +-- .../objects4j/vo/WeeklyOpeningHoursTest.java | 26 +++--- src/test/resources/META-INF/persistence.xml | 13 ++- 163 files changed, 884 insertions(+), 1097 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9a711c5..4662abe 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -23,10 +23,10 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'zulu' cache: maven diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index f3283b0..346d645 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/README.md b/README.md index aae0e22..ffa23f2 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,11 @@ A library with common Java types that are mostly immutable value objects. [![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=org.fuin%3Aobjects4j&metric=coverage)](https://sonarcloud.io/dashboard?id=org.fuin%3Aobjects4j) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.fuin/objects4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.fuin/objects4j/) [![LGPLv3 License](http://img.shields.io/badge/license-LGPLv3-blue.svg)](https://www.gnu.org/licenses/lgpl.html) -[![Java Development Kit 11](https://img.shields.io/badge/JDK-11-green.svg)](https://openjdk.java.net/projects/jdk/11/) +[![Java Development Kit 17](https://img.shields.io/badge/JDK-17-green.svg)](https://openjdk.java.net/projects/jdk/17/) ## Versions -- 0.8.x (or later) = **Java 11** with new **jakarta** namespace +- 0.9.x (or later) = **Java 17** +- 0.8.0 = **Java 11** with new **jakarta** namespace - 0.7.x = **Java 11** before namespace change from 'javax' to 'jakarta' - 0.6.9 (or previous) = **Java 8** diff --git a/pom.xml b/pom.xml index 19576fd..9607493 100644 --- a/pom.xml +++ b/pom.xml @@ -7,12 +7,12 @@ org.fuin pom - 1.8.0-SNAPSHOT + 1.9.0 objects4j bundle - 0.8.1-SNAPSHOT + 0.9.0-SNAPSHOT A library with common Java types that are mostly immutable value objects. http://www.fuin.org/objects4j/ @@ -35,86 +35,86 @@ org.fuin utils4j - 0.12.1-SNAPSHOT + 0.13.0 jakarta.xml.bind jakarta.xml.bind-api - 3.0.0 + 4.0.1 jakarta.json jakarta.json-api - 2.0.1 + 2.1.3 jakarta.json.bind jakarta.json.bind-api - 2.0.0 + 3.0.0 jakarta.validation jakarta.validation-api - 3.0.0 + 3.0.2 jakarta.enterprise jakarta.enterprise.cdi-api - 3.0.0 + 4.0.1 jakarta.persistence jakarta.persistence-api - 3.0.0 + 3.1.0 jakarta.mail jakarta.mail-api - 2.0.1 + 2.1.2 - junit - junit - 4.13.2 + org.junit.jupiter + junit-jupiter + 5.10.1 test org.assertj assertj-core - 3.20.2 + 3.24.2 test org.fuin units4j - 0.10.1-SNAPSHOT + 0.11.0 test org.easymock easymock - 4.3 + 5.2.0 test jakarta.el jakarta.el-api - 4.0.0 + 5.0.1 test @@ -128,56 +128,56 @@ org.jboss.weld.se weld-se-core - 4.0.2.Final + 5.1.2.Final test org.jboss jandex - 2.4.0.Final + 3.1.6 test org.slf4j slf4j-api - 1.7.30 + 2.0.9 test - org.slf4j - slf4j-log4j12 - 1.7.30 + ch.qos.logback + logback-core + 1.4.14 test - log4j - log4j - 1.2.17 + ch.qos.logback + logback-classic + 1.4.14 test org.hibernate.validator hibernate-validator - 7.0.1.Final + 8.0.1.Final test - org.eclipse.persistence - eclipselink - 3.0.0 + org.hibernate.orm + hibernate-core + 6.4.1.Final test - + org.hsqldb hsqldb - 2.6.0 + 2.7.2 test org.fuin.objects4j.vo.CurrencyAmountParentEntity org.fuin.objects4j.vo.CurrencyAmountConverter @@ -64,16 +67,18 @@ - + - + +