I am currently building and maintaining a library of objects which runs on Android. The library is mostly pure Java; the only Android-specific code is android.util.Log, which is far more useful in an Android environment than System.out.println(). My build & test environment for this library is basically JDK 1.7, Ant, command line and a text editor. Using JUnit 4.11 for unit testing is fine apart from when it hits part of the library code which uses android.util.Log, at which point I get:
I've tried using the Robolectric "android-all-xxx" library, but I then get:
It would seem then that android.util.Log hasn't actually been implemented by Robolectric. Is this actually the case, or am I missing something? Do I have to use the Robolectric TestRunner or can I use the standard JUnit one?
Code:
Exception in thread "main" java.lang.RuntimeException: Stub!
I've tried using the Robolectric "android-all-xxx" library, but I then get:
Code:
java.lang.UnsatisfiedLinkError: android.util.Log.println_native(IILjava/lang/String;Ljava/lang/String;)I
[java] at android.util.Log.println_native(Native Method)
[java] at android.util.Log.i(Log.java:160)
It would seem then that android.util.Log hasn't actually been implemented by Robolectric. Is this actually the case, or am I missing something? Do I have to use the Robolectric TestRunner or can I use the standard JUnit one?