Slide 47
Slide 47 text
Testing Migrations - Migrate and validate
@Test
public void migrationFrom1To2_containsCorrectData () throws IOException {
SupportSQLiteDatabase db = mMigrationTestHelper.createDatabase (DB_NAME, 1);
db.execSQL ("INSERT INTO attendee VALUES(" + ATTENDEE.getId () + ",'"
+ ATTENDEE.getName () + "','" + ATTENDEE.getEmail () + "','"
+ ATTENDEE.getCategory () + "')");
db.close ();
mMigrationTestHelper.runMigrationsAndValidate (DB_NAME, 2, validateDroppedTables
,
MIGRATION_1_2);
...
}