You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to use your mock (thank you for that) but
a) I can't get it to work :D
b) I'm wondering if this class should be located in /src/test/java/android/util instead of /src/main/java/android/util? The reason being I believe that currently it would be included in the APK and not just in the test. Thoughts?
-MIke
The text was updated successfully, but these errors were encountered:
Here is the main reason that I can see for using this mock of the android Log.
You have some code that could be used on the jvm and not just on android, so you want to remove all the android dependencies.
This is useful if you want to use the library with a jvm project, but also if you want to have simple junit tests that do not run within an android environment and therefore run much faster.
Here's how I am structuring my code for this (using gradle).
Move all the non-android specific code to a regular java library (module), and add the mock as a provided dependency of that library, and also as a testCompile dependency of the library.
For an android app that is going to use the code, I use the library as is, there's no need to include any other dependency. The mock code will not end up in the apk.
For regular jvm code (it could be a jvm app, another non-android specific java library or junit tests), I use the library and I also add the dependency on the mock with the compile scope (or testCompile for unit tests).
Hi,
I'm trying to use your mock (thank you for that) but
a) I can't get it to work :D
b) I'm wondering if this class should be located in /src/test/java/android/util instead of /src/main/java/android/util? The reason being I believe that currently it would be included in the APK and not just in the test. Thoughts?
-MIke
The text was updated successfully, but these errors were encountered: