-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 27
-
Component/s: tools
During implementation of JDK-8365776, several utility methods were annotated with @Test. JUnit only executes test methods that return `void`, and the misplaced annotation now produces warnings:
[WARNING] @Test method 'public java.lang.String ErrorTranslationTest.getKind(javax.tools.Diagnostic$Kind)' must not return a value. It will not be executed.
Source: MethodSource [className = 'ErrorTranslationTest', methodName = 'getKind', methodParameterTypes = 'javax.tools.Diagnostic$Kind']
at ErrorTranslationTest.getKind(SourceFile:0)
[WARNING] @Test method 'public jdk.jshell.JShell$Builder IdGeneratorTest.getBuilder()' must not return a value. It will not be executed.
Source: MethodSource [className = 'IdGeneratorTest', methodName = 'getBuilder', methodParameterTypes = '']
at IdGeneratorTest.getBuilder(SourceFile:0)
[WARNING] @Test method 'public java.io.File[] KullaCompletenessStressTest.getDirectoriesToTest()' must not return a value. It will not be executed.
Source: MethodSource [className = 'KullaCompletenessStressTest', methodName = 'getDirectoriesToTest', methodParameterTypes = '']
at KullaCompletenessStressTest.getDirectoriesToTest(SourceFile:0)
These warnings need to be fixed before CODETOOLS-7904125 can be implemented.
[WARNING] @Test method 'public java.lang.String ErrorTranslationTest.getKind(javax.tools.Diagnostic$Kind)' must not return a value. It will not be executed.
Source: MethodSource [className = 'ErrorTranslationTest', methodName = 'getKind', methodParameterTypes = 'javax.tools.Diagnostic$Kind']
at ErrorTranslationTest.getKind(SourceFile:0)
[WARNING] @Test method 'public jdk.jshell.JShell$Builder IdGeneratorTest.getBuilder()' must not return a value. It will not be executed.
Source: MethodSource [className = 'IdGeneratorTest', methodName = 'getBuilder', methodParameterTypes = '']
at IdGeneratorTest.getBuilder(SourceFile:0)
[WARNING] @Test method 'public java.io.File[] KullaCompletenessStressTest.getDirectoriesToTest()' must not return a value. It will not be executed.
Source: MethodSource [className = 'KullaCompletenessStressTest', methodName = 'getDirectoriesToTest', methodParameterTypes = '']
at KullaCompletenessStressTest.getDirectoriesToTest(SourceFile:0)
These warnings need to be fixed before CODETOOLS-7904125 can be implemented.
- caused by
-
JDK-8365776 Convert JShell tests to use JUnit instead of TestNG
-
- Resolved
-
- relates to
-
CODETOOLS-7904125 Report JUnit issues encountered during test discovery
-
- New
-