android - Robolectric 2 with JNI -
in app stared using external library uses jni.
system.loadlibrary("somelib")
also have unitests robolectric 2
. when i'm running these tests i'm getting following exception:
java.lang.unsatisfiedlinkerror: no dafprovider in java.library.path
how configure robolectric
load native library?
note: i'm using maven
unfortunately, robolectric doesn't work jni. suggestion wrap jni library loading class , mock under test, or override jni method loading in test:
public class myapp extends application { public void oncreate() { loadjni(); } protected void loadjni() { system.loadlibrary("somelib"); } }
in tests:
public class testmyapp extends myapp { @override protected void loadjni() { //don't } }
Comments
Post a Comment