I trying to setup an testing environment for my android project. The basic Robolectric setup is done. I used this nice tutorial. If I comment out SugarORM in my Manifest.xml
Ok try next. Add next class to you test code:
public class TestSugarApp
extends SugarApp
{
@Override
public void onCreate() {}
@Override
public void onTerminate() {}
}
The class named Test will be loaded and used by Robolectric and you can override some things that are not relevant for testing. I'm trying to prevent to execute code from SugarApp
in onCreate
and onTerminate
(https://github.com/satyan/sugar/blob/master/library/src/com/orm/SugarApp.java).