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

Convert some Java tests to Kotlin #13792

Conversation

jamesonwilliams
Copy link
Contributor

Contributor checklist

  • This runs on the local host, not the device
  • 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

There's still quite a bit of Java left in the codebase. It probably makes sense to convert the low-risk stuff to Kotlin, first (e.g., sample apps, unit test files, etc.)

Here I just grabbed a random batch of test files that were still in Java and converted them to Kotlin. I started with Android Studio's "Convert Java to Kotlin..." utility and then applied some manual cleanups.

  1. core-util-jvm/src/test/java/org/signal/core/util/logging/LogTest.kt
  2. core-util/src/test/java/org/signal/core/util/BreakIteratorCompatTest.kt
  3. core-util/src/test/java/org/signal/core/util/ListUtilTest.kt
  4. core-util/src/test/java/org/signal/core/util/money/FiatMoneyTest.kt
  5. device-transfer/lib/src/test/java/org/signal/devicetransfer/DeviceTransferAuthenticationTest.kt
  6. device-transfer/lib/src/test/java/org/signal/devicetransfer/WifiDirectTest.kt
  7. donations/app/src/main/java/org/signal/donations/app/MainActivity.kt
  8. libsignal-service/src/test/java/org/whispersystems/util/FlagUtilTest.kt
  9. paging/lib/src/test/java/org/signal/paging/DataStatusTest.kt

Test files are also good candidates to finish migrating because it's easy to verify that they still work or not:

./gradlew :core-util-jvm:test :device-transfer:test :donations:test :libsignal-service:test :paging:test

@jamesonwilliams jamesonwilliams force-pushed the convert-some-tests-to-kotlin branch from e6cb5a3 to 1ab22fc Compare November 16, 2024 06:52
@greyson-signal
Copy link
Contributor

Thank you! Always better to have more things moved over to kotlin, and I agree that tests are a great place to start.

greyson-signal pushed a commit that referenced this pull request Nov 21, 2024
TheTechZone pushed a commit to Cerenia/Signal-Android that referenced this pull request Jan 6, 2025
TheTechZone pushed a commit to Cerenia/Signal-Android that referenced this pull request Jan 6, 2025
AbandonedCart pushed a commit to SamSprung/Signal-Android that referenced this pull request Jan 31, 2025
Fix mark registration complete flag.

Add extra catch to adding system contact links.

Update translations and other static files.

Bump version to 7.25.1

Fix bad active state check for subscriptions.

Bump version to 7.25.2

Remove old donation jobs.

Update libsignal-net integration to match libsignal v0.62.0.

Add MediaTTL to subscriptions configuration and wire in.

Normalize receipt labeling.

Add a .tool-versions to indicate which version of java should be used.

Add backup specific strings for token redemption error.

Add copy for paid-tier-pending dialog.

Update to actions/upload-artifact v4.

Include unregistered users in blocked sync message.

Detect storage space issues during restore.

Hardcode auto-provisioning in Gradle to off.

Fix restore/transfer string typos.

Resolve some gradle 8 deprecations.

Resolves signalapp#13788

Remove unreachable dependencies from verification-metadata.xml

I did this by clearing the components entries:

perl -i -0777 -pe 's/<components>.*?<\/components>//gs'  gradle/verification-metadata.xml

And then regenerating them:

./gradlew --write-verification-metadata sha256 qa --rerun-tasks

Resolves signalapp#13791

Convert some Java tests to Kotlin.

Resolves signalapp#13792

Switch to using toml version catalogs.

Resolves signalapp#13792

Prevent displaying AppSettings content until self is non-null.

Display proper error when call link deletion fails due to call link being in use.

Convert InternalValues to kotlin.

Implement checkin job for backups.

Change the JobDatabase to use a different error handler.

Relates to signalapp#13762

Remove redundant zkcCredential=true

Add deletion method to ArchiveApi.

Sync the MediaRootBackupKey during linking.

Fix link+sync uploads.

Update link+sync ui.

Remove mockito usage from android tests.

Rotate the link+sync flag.

Update bug_report.yaml

Resolves signalapp#13803

Remove junit.framework

Resolves signalapp#13805

Remove BaseUnitTest.java

Resolves signalapp#13804

Make LibSignalChatConnection Only Use Each ChatService Once

Introduce AEP and SSRE2.

Added a Storage Service Playground screen.

Update backup string (digit -> character).

Utilize fixed test address for mockwebserver.

Improve error reporting in storage service playground.

Allow stories to be embedded with link previews that do not have titles.

Update translations and other static files.
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