Återställ alla singleton-instanser mellan varje test annars får du biverkningar som dina.
@After
public void finishComponentTesting() {
resetSingleton(YourSQLiteOpenHelper.class, "sInstance");
}
private void resetSingleton(Class clazz, String fieldName) {
Field instance;
try {
instance = clazz.getDeclaredField(fieldName);
instance.setAccessible(true);
instance.set(null, null);
} catch (Exception e) {
throw new RuntimeException();
}
}