I often find myself duplicating the exact same set of test classes such as 
mocks or helpers for both Android Tests `/androidTest` and Unit Tests 
`/test` when writing tests for an application module.

For example, I have some static functions that help me set up mocks quickly 
in `/test/MockUtils.java` However, I cannot reuse this helper class in any 
of my AndroidTests because they do not share the same class path - 
`/androidTest` vs `/test`.

I've thought of creating a new module that only contains test resources. 
However, this idea won't fly because the Android Gradle plugin refuses to 
depend on an app module.

    project testCommon resolves to an APK archive which is not supported as 
a compilation dependency.

Is there any other way to create test classes that could be reused in both 
Android Tests and Unit Tests?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to