-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 8, 27
-
Component/s: core-libs
JUnit only executes test methods that are not static; test annotations on static methods have no effect, and annotated methods are never executed.
Both test methods in the PreserveTagCase test are static.
Starting with JUnit 5.13, the test produces the following warnings:
WARNING: TestEngine with ID 'junit-jupiter' encountered 2 non-critical issues during test discovery:
(1) [WARNING] @TestTemplate method 'public static void PreserveTagCase.testLookupTag(java.lang.String,java.util.List<java.lang.String>,java.lang.String)' must not be static. It will not be executed.
Source: MethodSource [className = 'PreserveTagCase', methodName = 'testLookupTag', methodParameterTypes = 'java.lang.String, java.util.List, java.lang.String']
at PreserveTagCase.testLookupTag(SourceFile:0)
(2) [WARNING] @TestTemplate method 'public static void PreserveTagCase.testFilterTags(java.lang.String,java.util.List<java.lang.String>,java.util.List<java.lang.String>,java.util.Locale$FilteringMode)' must not be static. It will not be executed.
Source: MethodSource [className = 'PreserveTagCase', methodName = 'testFilterTags', methodParameterTypes = 'java.lang.String, java.util.List, java.util.List, java.util.Locale$FilteringMode']
at PreserveTagCase.testFilterTags(SourceFile:0)
Both test methods in the PreserveTagCase test are static.
Starting with JUnit 5.13, the test produces the following warnings:
WARNING: TestEngine with ID 'junit-jupiter' encountered 2 non-critical issues during test discovery:
(1) [WARNING] @TestTemplate method 'public static void PreserveTagCase.testLookupTag(java.lang.String,java.util.List<java.lang.String>,java.lang.String)' must not be static. It will not be executed.
Source: MethodSource [className = 'PreserveTagCase', methodName = 'testLookupTag', methodParameterTypes = 'java.lang.String, java.util.List, java.lang.String']
at PreserveTagCase.testLookupTag(SourceFile:0)
(2) [WARNING] @TestTemplate method 'public static void PreserveTagCase.testFilterTags(java.lang.String,java.util.List<java.lang.String>,java.util.List<java.lang.String>,java.util.Locale$FilteringMode)' must not be static. It will not be executed.
Source: MethodSource [className = 'PreserveTagCase', methodName = 'testFilterTags', methodParameterTypes = 'java.lang.String, java.util.List, java.util.List, java.util.Locale$FilteringMode']
at PreserveTagCase.testFilterTags(SourceFile:0)
- caused by
-
JDK-8310818 Refactor more Locale tests to use JUnit
-
- Resolved
-
- relates to
-
CODETOOLS-7904125 Report JUnit issues encountered during test discovery
-
- New
-