Skip to content

Commit

Permalink
Upgrades JUnit to version 5.11.x
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ppkarwasz committed Oct 7, 2024
1 parent a306d95 commit 4c3c4c7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
@Target({TYPE, METHOD})
@Inherited
@Documented
@ExtendWith(ExtensionContextAnchor.class)
@ExtendWith(TestPropertyResolver.class)
@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class})
@Repeatable(SetTestProperty.SetTestProperties.class)
@ReadsSystemProperty
@ReadsEnvironmentVariable
Expand All @@ -54,7 +53,7 @@
@Target({TYPE, METHOD})
@Documented
@Inherited
public @interface SetTestProperties {
@interface SetTestProperties {

SetTestProperty[] value();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
@Target({FIELD, PARAMETER})
@Inherited
@Documented
@ExtendWith(ExtensionContextAnchor.class)
@ExtendWith(TempLoggingDirectory.class)
@ExtendWith({ExtensionContextAnchor.class, TempLoggingDirectory.class})
public @interface TempLoggingDir {

CleanupMode cleanup() default CleanupMode.DEFAULT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
@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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
@Target({TYPE, METHOD})
@Inherited
@Documented
@ExtendWith(ExtensionContextAnchor.class)
@ExtendWith(TestPropertyResolver.class)
@ExtendWith({ExtensionContextAnchor.class, TestPropertyResolver.class})
@ReadsSystemProperty
@ReadsEnvironmentVariable
public @interface UsingTestProperties {}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@
@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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion log4j-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 4c3c4c7

Please sign in to comment.