defects4j icon indicating copy to clipboard operation
defects4j copied to clipboard

Mockito-5b is missing junit from its classpath

Open andrewhabib opened this issue 3 years ago • 2 comments

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,

andrewhabib avatar Jul 28 '21 20:07 andrewhabib

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é

rjust avatar Jul 30 '21 06:07 rjust

Sure, I am doing my own workarounds.

Actually, several of Mockito bugs are missing junit from the compile path.

andrewhabib avatar Jul 31 '21 09:07 andrewhabib