defects4j
defects4j copied to clipboard
Mockito-5b is missing junit from its classpath
Hi,
The buggy version of Mockito-5 (Mockito-5b) is missing junit jar on the compile path.
Although defects4j compiles Mockito-5b without failure (probably through some other junit dependency defined in the build file), any analysis, e.g., trying to compile the buggy file using the provided compilepath will fail because junit is missing.
For instance, the following compilation command of the buggy file will fail. Adding junit to its classpath solves the problem.
javac -cp ${mockito-5b-compilepath} Mockito-5/src/org/mockito/internal/verification/VerificationOverTimeImpl.java
Mockito-5/src/org/mockito/internal/verification/VerificationOverTimeImpl.java:80: error: cannot access ComparisonFailure
try {
^
class file for junit.framework.ComparisonFailure not found
1 error
It is not required for the fixed version since the fix remove the sole call to one of junit APIs.
Thank you,
Thanks for reporting this.
Yes, Defects4J puts JUnit 4.11 on the classpath by default. We will look into exporting the correct classpath. As a workaround you can append JUnit 4.11 to your classpath.
Best, René
Sure, I am doing my own workarounds.
Actually, several of Mockito bugs are missing junit from the compile path.