@Test public void onUpgrade_dropsTableAndCreatesTable() { mMockContent.onUpgrade(mContext, mSqLiteDatabase, 1); verify(mSqLiteDatabase).execSQL("DROP TABLE EMIR"); verify(mSqLiteDatabase).execSQL("CREATE TABLE EMIR"); }
public void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion) { final int currentVersion = getVersion(context); if (oldVersion != currentVersion) { final String drop = getDrop(context); final String create = getCreate(context); sqLiteDatabase.execSQL(drop); sqLiteDatabase.execSQL(create); } }
Content { public void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion) { final int currentVersion = getVersion(context); if (oldVersion != currentVersion) { final String drop = getDrop(context); final String create = getCreate(context); sqLiteDatabase.execSQL(drop); sqLiteDatabase.execSQL(create); } } }
Content { public void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion) { final int currentVersion = getVersion(context); if (oldVersion != currentVersion) { final String drop = getDrop(context); final String create = getCreate(context); sqLiteDatabase.execSQL(drop); sqLiteDatabase.execSQL(create); } }  }
Content { public void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion) { final int currentVersion = getVersion(context); if (oldVersion != currentVersion) { final String drop = getDrop(context); final String create = getCreate(context); sqLiteDatabase.execSQL(drop); sqLiteDatabase.execSQL(create); } }  abstract int getVersion(final Context context); abstract String getName(final Context context); abstract String getCreate(final Context context); abstract String getDrop(final Context context); abstract List<Path> getPaths(final Context context); void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion); Cursor query(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final String[] projection, final String selection, final String[] selectionArgs, final String sortOrder); String type(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri); Uri insert(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final ContentValues values); int delete(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final String selection, final String[] selectionArgs); int update(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final ContentValues values, final String selection, final String[] selectionArgs); int bulkInsert(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final ContentValues[] contentValuesArray); }
Content { public void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion) { final int currentVersion = getVersion(context); if (oldVersion != currentVersion) { final String drop = getDrop(context); final String create = getCreate(context); sqLiteDatabase.execSQL(drop); sqLiteDatabase.execSQL(create); } }  abstract int getVersion(final Context context); abstract String getName(final Context context); abstract String getCreate(final Context context); abstract String getDrop(final Context context); abstract List<Path> getPaths(final Context context); void onUpgrade(final Context context, final SQLiteDatabase sqLiteDatabase, final int oldVersion); Cursor query(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final String[] projection, final String selection, final String[] selectionArgs, final String sortOrder); String type(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri); Uri insert(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final ContentValues values); int delete(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final String selection, final String[] selectionArgs); int update(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final ContentValues values, final String selection, final String[] selectionArgs); int bulkInsert(final Context context, final SQLiteDatabase sqLiteDatabase, final Path path, final Uri uri, final ContentValues[] contentValuesArray);  }