Skip to content

Commit 2d61fe0

Browse files
authored
Upgrades JUnit to version 5.11.x (#3069)
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. Note: the bug is already fixed and the fix will appear in version `5.11.3`.
1 parent ab0fdbc commit 2d61fe0

File tree

8 files changed

+14
-19
lines changed

8 files changed

+14
-19
lines changed

log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/SetTestProperty.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
@Target({TYPE, METHOD})
4040
@Inherited
4141
@Documented
42-
@ExtendWith(ExtensionContextAnchor.class)
43-
@ExtendWith(TestPropertyResolver.class)
42+
@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class})
4443
@Repeatable(SetTestProperty.SetTestProperties.class)
4544
@ReadsSystemProperty
4645
@ReadsEnvironmentVariable
@@ -54,7 +53,7 @@
5453
@Target({TYPE, METHOD})
5554
@Documented
5655
@Inherited
57-
public @interface SetTestProperties {
56+
@interface SetTestProperties {
5857

5958
SetTestProperty[] value();
6059
}

log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/TempLoggingDir.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
@Target({FIELD, PARAMETER})
3838
@Inherited
3939
@Documented
40-
@ExtendWith(ExtensionContextAnchor.class)
41-
@ExtendWith(TempLoggingDirectory.class)
40+
@ExtendWith({ExtensionContextAnchor.class, TempLoggingDirectory.class})
4241
public @interface TempLoggingDir {
4342

4443
CleanupMode cleanup() default CleanupMode.DEFAULT;

log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingStatusListener.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,5 @@
3535
@Retention(RUNTIME)
3636
@Target({TYPE, METHOD})
3737
@Documented
38-
@ExtendWith(ExtensionContextAnchor.class)
39-
@ExtendWith(TestPropertyResolver.class)
40-
@ExtendWith(StatusListenerExtension.class)
38+
@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class, StatusListenerExtension.class})
4139
public @interface UsingStatusListener {}

log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/UsingTestProperties.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
@Target({TYPE, METHOD})
3838
@Inherited
3939
@Documented
40-
@ExtendWith(ExtensionContextAnchor.class)
41-
@ExtendWith(TestPropertyResolver.class)
40+
@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class})
4241
@ReadsSystemProperty
4342
@ReadsEnvironmentVariable
4443
public @interface UsingTestProperties {}

log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/package-info.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
* limitations under the license.
1616
*/
1717
@Export
18-
@Version("2.24.0")
19-
@BaselineIgnore("2.24.0")
18+
@Version("2.24.1")
2019
package org.apache.logging.log4j.test.junit;
2120

22-
import aQute.bnd.annotation.baseline.BaselineIgnore;
2321
import org.osgi.annotation.bundle.Export;
2422
import org.osgi.annotation.versioning.Version;

log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/LoggerContextSource.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@
5252
@Documented
5353
@Inherited
5454
@Tag("functional")
55-
@ExtendWith(TempLoggingDirectory.class)
56-
@ExtendWith(LoggerContextResolver.class)
57-
@ExtendWith(ConfigurationResolver.class)
58-
@ExtendWith(AppenderResolver.class)
55+
@ExtendWith({
56+
TempLoggingDirectory.class,
57+
LoggerContextResolver.class,
58+
ConfigurationResolver.class,
59+
AppenderResolver.class
60+
})
5961
public @interface LoggerContextSource {
6062
/**
6163
* Specifies the name of the configuration file to use for the annotated test.

log4j-core-test/src/main/java/org/apache/logging/log4j/core/test/junit/package-info.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* @see org.junit.rules.TestRule
2121
*/
2222
@Export
23-
@Version("2.23.0")
23+
@Version("2.23.1")
2424
package org.apache.logging.log4j.core.test.junit;
2525

2626
import org.osgi.annotation.bundle.Export;

log4j-parent/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<jmdns.version>3.5.12</jmdns.version>
110110
<jmh.version>1.37</jmh.version>
111111
<junit.version>4.13.2</junit.version>
112-
<junit-jupiter.version>5.10.3</junit-jupiter.version>
112+
<junit-jupiter.version>5.11.2</junit-jupiter.version>
113113
<junit-pioneer.version>1.9.1</junit-pioneer.version>
114114
<kafka.version>3.8.0</kafka.version>
115115
<lightcouch.version>0.2.0</lightcouch.version>

0 commit comments

Comments
 (0)