Hi Everyone, I am writing unit test cases in my an...
# android
a
Hi Everyone, I am writing unit test cases in my android app which is following multi module clean architecture. I have created a shared test module to share common test logic to share across all the test classes in all the other modules. This shared test module is android lib module. I am have no problem sharing common test logic with app module which is also android module . But i am not able to resolve the references of the shared test module classes in data module(which is a java/kotlin module) during the runtime. For testing, i created another android lib module and tried to access shared test logic and it worked but i am not able to resolve the classes with non android lb modules. I have stackover question also where i have explained the problem in a detailed way please refer https://stackoverflow.com/questions/67383020/shared-test-classes-in-multimdule-android-project
m
I have answered your question, hopefully it'll help you with your issue
a
@Martin Feldsztejn Thanks for having a look. I actually need that common-test to be android module as i need some android specific libraries for test.I have edited my question on stack overflow
m
You are right, unfortunately the core-testing lib is an aar, but I’ve also responded to a comment with a suggestion
It’s probably not the answer you where looking for but I think its the only one for this circumstance
You might want to also check the questions since you wrote
testImplementation "androidx.arch.core:core-testing:1.1.1"
under the
common-test/build.gradle
and it looks like you meant
implementation "androidx.arch.core:core-testing:1.1.1"
a
@Martin Feldsztejn Yes , i have updated the question and if separating android and java test module is the only way i will do that way as a last resort.
m
Sorry I couldn’t be more helpful, I think thats the way you’ll have to go because there is not 2-way support 😞
a
@Martin Feldsztejn no worries thanks for the reply may be would go about doing what u suggested