McTester icon indicating copy to clipboard operation
McTester copied to clipboard

Decide on future of Kotlin support

Open Aaron1011 opened this issue 5 years ago • 1 comments

I really like being able to write tests in Kotlin using coroutines. However, supporting both normal and coroutine tests imposes a non-trivial maintenance burden:

Specifically, any blocking method - which includes every single method in Client - needs to be duplicated. I don't see any way of getting around this - normal Java code can't call a suspend function, and Kotlin code has to call a suspend function if it wants to avoid blocking.

I see two ways forward:

  • Continue to support both Kotlin and Java. We'll have to try and reduce the confusion over which methods to use, however.
  • Drop Java support, and only support writing tests in Kotlin. While this would simplify the API and implementation, it would impose a non-trivial barrier for users looking to get started with McTester. For people with no experience with Kotlin, they would need to learn (parts of) a new language to even write a simple test.

From what I've seen, there doesn't seem to be any way of making a single suspendable method callable from both Java and kotlin - and to make it block when called from Java, and suspend when called from Kotlin. If anyone knows of a way to accomplish this, it would be incredibly helpful.

Aaron1011 avatar Jul 17 '18 23:07 Aaron1011