Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change mocking framework to be Java 11+ compatible #6809

Closed
aikebah opened this issue Jul 6, 2024 · 0 comments · Fixed by #6922
Closed

Change mocking framework to be Java 11+ compatible #6809

aikebah opened this issue Jul 6, 2024 · 0 comments · Fixed by #6922
Assignees

Comments

@aikebah
Copy link
Collaborator

aikebah commented Jul 6, 2024

Uncovered in the attempts to upgrade to Java 11: The JMockit library is not compatible with modern java, causing JaCoCo to run into IndexOutOfBoundExceptions in coverage analysis

See also jacoco/jacoco#896 (comment)

Changing <jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version> to <jacoco-maven-plugin.version>0.8.3</jacoco-maven-plugin.version> resolves

[ERROR] Errors: 
[ERROR] org.owasp.dependencycheck.AnalysisTaskTest.shouldAnalyzeReturnsFalseIfTheFileTypeAnalyzerDoesNotAcceptTheDependency
[ERROR]   Run 1: AnalysisTaskTest.shouldAnalyzeReturnsFalseIfTheFileTypeAnalyzerDoesNotAcceptTheDependency » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[ERROR]   Run 2: AnalysisTaskTest.shouldAnalyzeReturnsFalseIfTheFileTypeAnalyzerDoesNotAcceptTheDependency » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[INFO] 
[ERROR] org.owasp.dependencycheck.AnalysisTaskTest.shouldAnalyzeReturnsTrueForNonFileTypeAnalyzers
[ERROR]   Run 1: AnalysisTaskTest.shouldAnalyzeReturnsTrueForNonFileTypeAnalyzers » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[ERROR]   Run 2: AnalysisTaskTest.shouldAnalyzeReturnsTrueForNonFileTypeAnalyzers » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[INFO] 
[ERROR] org.owasp.dependencycheck.AnalysisTaskTest.shouldAnalyzeReturnsTrueIfTheFileTypeAnalyzersAcceptsTheDependency
[ERROR]   Run 1: AnalysisTaskTest.shouldAnalyzeReturnsTrueIfTheFileTypeAnalyzersAcceptsTheDependency » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[ERROR]   Run 2: AnalysisTaskTest.shouldAnalyzeReturnsTrueIfTheFileTypeAnalyzersAcceptsTheDependency » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[INFO] 
[ERROR] org.owasp.dependencycheck.AnalysisTaskTest.taskAnalyzes
[ERROR]   Run 1: AnalysisTaskTest.taskAnalyzes » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[ERROR]   Run 2: AnalysisTaskTest.taskAnalyzes » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[INFO] 
[ERROR] org.owasp.dependencycheck.AnalysisTaskTest.taskDoesNothingIfItShouldNotAnalyze
[ERROR]   Run 1: AnalysisTaskTest.taskDoesNothingIfItShouldNotAnalyze » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[ERROR]   Run 2: AnalysisTaskTest.taskDoesNothingIfItShouldNotAnalyze » ArrayIndexOutOfBounds Index 2562 out of bounds for length 777
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testAnalyze
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testAnalyze » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testAnalyze » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testFirstPathIsShortest
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testFirstPathIsShortest » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testFirstPathIsShortest » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testGetAnalysisPhase
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testGetAnalysisPhase » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testGetAnalysisPhase » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testGetName
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testGetName » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testGetName » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testIsCore
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testIsCore » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testIsCore » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testIsShaded
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testIsShaded » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testIsShaded » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest.testIsWebJar
[ERROR]   Run 1: DependencyBundlingAnalyzerTest.testIsWebJar » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[ERROR]   Run 2: DependencyBundlingAnalyzerTest.testIsWebJar » ArrayIndexOutOfBounds Index 3588 out of bounds for length 1169
[INFO] 
[ERROR] org.owasp.dependencycheck.data.update.EngineVersionCheckTest.testGetCurrentReleaseVersion
[ERROR]   Run 1: EngineVersionCheckTest.testGetCurrentReleaseVersion » ArrayIndexOutOfBounds Index 3849 out of bounds for length 2392
[ERROR]   Run 2: EngineVersionCheckTest.testGetCurrentReleaseVersion » ArrayIndexOutOfBounds Index 3849 out of bounds for length 2392
[INFO] 
[ERROR] org.owasp.dependencycheck.data.update.EngineVersionCheckTest.testShouldUpdate
[ERROR]   Run 1: EngineVersionCheckTest.testShouldUpdate » ArrayIndexOutOfBounds Index 3849 out of bounds for length 2392
[ERROR]   Run 2: EngineVersionCheckTest.testShouldUpdate » ArrayIndexOutOfBounds Index 3849 out of bounds for length 2392

Indicating that the test-failures I see locally are caused by this outdated and apparently unmaintained (see e.g. discussion on jmockit/jmockit1#729) Mock library

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant