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

Mockito-5b is missing junit from its classpath #426

Open
andrewhabib opened this issue Jul 28, 2021 · 2 comments
Open

Mockito-5b is missing junit from its classpath #426

andrewhabib opened this issue Jul 28, 2021 · 2 comments

Comments

@andrewhabib
Copy link

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,

@rjust
Copy link
Owner

rjust commented Jul 30, 2021

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é

@andrewhabib
Copy link
Author

Sure, I am doing my own workarounds.

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

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

No branches or pull requests

2 participants