You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2024/10/07 19:08:36 UTC
(logging-log4j2) 01/01: Upgrades JUnit to version 5.11.x
This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch feature/2.x/2843_junit_5_11
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 4c3c4c79bdadc70b1d8feeeae9a389372871cf3f
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Oct 7 21:08:24 2024 +0200
Upgrades JUnit to version 5.11.x
Due to a minor bug in JUnit 5.11.x (junit-team/junit5#4054), fields meta-annotated with multiple `@ExtendWith` annotations are no longer recognized.
We combine those annotations into single `@ExtendWith` annotations, which also looks better.
Closes #2843.
---
.../org/apache/logging/log4j/test/junit/SetTestProperty.java | 5 ++---
.../org/apache/logging/log4j/test/junit/TempLoggingDir.java | 3 +--
.../apache/logging/log4j/test/junit/UsingStatusListener.java | 4 +---
.../apache/logging/log4j/test/junit/UsingTestProperties.java | 3 +--
.../java/org/apache/logging/log4j/test/junit/package-info.java | 4 +---
.../logging/log4j/core/test/junit/LoggerContextSource.java | 10 ++++++----
.../org/apache/logging/log4j/core/test/junit/package-info.java | 2 +-
log4j-parent/pom.xml | 2 +-
8 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/SetTestProperty.java b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/SetTestProperty.java
index ff9a175d7a..9989235165 100644
--- a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/SetTestProperty.java
+++ b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/SetTestProperty.java
@@ -39,8 +39,7 @@ import org.junitpioneer.jupiter.ReadsSystemProperty;
@Target({TYPE, METHOD})
@Inherited
@Documented
-@ExtendWith(ExtensionContextAnchor.class)
-@ExtendWith(TestPropertyResolver.class)
+@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class})
@Repeatable(SetTestProperty.SetTestProperties.class)
@ReadsSystemProperty
@ReadsEnvironmentVariable
@@ -54,7 +53,7 @@ public @interface SetTestProperty {
@Target({TYPE, METHOD})
@Documented
@Inherited
- public @interface SetTestProperties {
+ @interface SetTestProperties {
SetTestProperty[] value();
}
diff --git a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/TempLoggingDir.java b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/TempLoggingDir.java
index 8a6af4c820..dab49ddd4d 100644
--- a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/TempLoggingDir.java
+++ b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/TempLoggingDir.java
@@ -37,8 +37,7 @@ import org.junit.jupiter.api.io.CleanupMode;
@Target({FIELD, PARAMETER})
@Inherited
@Documented
-@ExtendWith(ExtensionContextAnchor.class)
-@ExtendWith(TempLoggingDirectory.class)
+@ExtendWith({ExtensionContextAnchor.class, TempLoggingDirectory.class})
public @interface TempLoggingDir {
CleanupMode cleanup() default CleanupMode.DEFAULT;
diff --git a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingStatusListener.java b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingStatusListener.java
index 2ca8124b03..7fa198c509 100644
--- a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingStatusListener.java
+++ b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingStatusListener.java
@@ -35,7 +35,5 @@ import org.junit.jupiter.api.extension.ExtendWith;
@Retention(RUNTIME)
@Target({TYPE, METHOD})
@Documented
-@ExtendWith(ExtensionContextAnchor.class)
-@ExtendWith(TestPropertyResolver.class)
-@ExtendWith(StatusListenerExtension.class)
+@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class, StatusListenerExtension.class})
public @interface UsingStatusListener {}
diff --git a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingTestProperties.java b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingTestProperties.java
index 1a37b99832..6d66dd4e03 100644
--- a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingTestProperties.java
+++ b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingTestProperties.java
@@ -37,8 +37,7 @@ import org.junitpioneer.jupiter.ReadsSystemProperty;
@Target({TYPE, METHOD})
@Inherited
@Documented
-@ExtendWith(ExtensionContextAnchor.class)
-@ExtendWith(TestPropertyResolver.class)
+@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class})
@ReadsSystemProperty
@ReadsEnvironmentVariable
public @interface UsingTestProperties {}
diff --git a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/package-info.java b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/package-info.java
index e14cd8ee18..2a37b2933f 100644
--- a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/package-info.java
+++ b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/package-info.java
@@ -15,10 +15,8 @@
* limitations under the license.
*/
@Export
-@Version("2.24.0")
-@BaselineIgnore("2.24.0")
+@Version("2.24.1")
package org.apache.logging.log4j.test.junit;
-import aQute.bnd.annotation.baseline.BaselineIgnore;
import org.osgi.annotation.bundle.Export;
import org.osgi.annotation.versioning.Version;
diff --git a/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/LoggerContextSource.java b/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/LoggerContextSource.java
index 3367d6f095..152766c95c 100644
--- a/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/LoggerContextSource.java
+++ b/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/LoggerContextSource.java
@@ -52,10 +52,12 @@ import org.junit.jupiter.api.extension.ExtendWith;
@Documented
@Inherited
@Tag("functional")
-@ExtendWith(TempLoggingDirectory.class)
-@ExtendWith(LoggerContextResolver.class)
-@ExtendWith(ConfigurationResolver.class)
-@ExtendWith(AppenderResolver.class)
+@ExtendWith({
+ TempLoggingDirectory.class,
+ LoggerContextResolver.class,
+ ConfigurationResolver.class,
+ AppenderResolver.class
+})
public @interface LoggerContextSource {
/**
* Specifies the name of the configuration file to use for the annotated test.
diff --git a/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/package-info.java b/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/package-info.java
index 0fedb91e3a..4103b14804 100644
--- a/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/package-info.java
+++ b/log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/package-info.java
@@ -20,7 +20,7 @@
* @see org.junit.rules.TestRule
*/
@Export
-@Version("2.23.0")
+@Version("2.23.1")
package org.apache.logging.log4j.core.test.junit;
import org.osgi.annotation.bundle.Export;
diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml
index cb81b04b2c..4c82d04e14 100644
--- a/log4j-parent/pom.xml
+++ b/log4j-parent/pom.xml
@@ -109,7 +109,7 @@
<jmdns.version>3.5.12</jmdns.version>
<jmh.version>1.37</jmh.version>
<junit.version>4.13.2</junit.version>
- <junit-jupiter.version>5.10.3</junit-jupiter.version>
+ <junit-jupiter.version>5.11.2</junit-jupiter.version>
<junit-pioneer.version>1.9.1</junit-pioneer.version>
<kafka.version>3.8.0</kafka.version>
<lightcouch.version>0.2.0</lightcouch.version>