Code example for SQLiteDatabase

Methods: isOpen

0
    assertDatabaseOpened(database, helper);
    assertThat(helper.onCreateCalled).isFalse();
  } 
  private static void assertDatabaseOpened(SQLiteDatabase database, TestOpenHelper helper) {
    assertThat(database).isNotNull();
    assertThat(database.isOpen()).isTrue();
    assertThat(helper.onOpenCalled).isTrue();
    assertThat(helper.onUpgradeCalled).isFalse();
  } 
  private class TestOpenHelper extends SQLiteOpenHelper {
    public boolean onCreateCalled;
    public boolean onUpgradeCalled;
    public boolean onOpenCalled;
 
    public TestOpenHelper(Context context, String name, CursorFactory factory, int version) {
      super(context, name, factory, version);
      reset(); 
    } 
 
    @Override 
      public void onCreate(SQLiteDatabase database) {