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

Remove junit.framework #13805

Closed

Conversation

jamesonwilliams
Copy link
Contributor

@jamesonwilliams jamesonwilliams commented Nov 20, 2024

Contributor checklist

  • Local development machine for JVM tests
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

The junit.framework is leftover from JUnit 3, although most of the Android community uses the JUnit 4.x series. JUnit 4.x uses the import org.junit.

I did a global replace-all of some common junit.framework imports and replaced them with their org.junit analogs.

TestCase is a one special case; it is necessary to add @Test on functions in classes that wear extends TestCase.

In a few places I fixed the order of expected/actual calls to assertEquals(...) (again through a regular expression that automatically swapped them.)

In a few places I added assertThrows where there had been a try/catch construct used haphazardly instead

At the end of all this, this is the result:

$ rg junit\.framework
microbenchmark/benchmark-proguard-rules.pro:-dontnote junit.framework.**

Also, this passes:

./gradlew qa
[...snip...]
BUILD SUCCESSFUL in 3m 2s

@greyson-signal
Copy link
Contributor

Awesome, thanks so much! I'll sleep happier knowing I won't have to remember which assert to import :)

@jamesonwilliams jamesonwilliams deleted the remove-junit.framework branch November 21, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants