diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/AllWidgetsFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/AllWidgetsFormTest.java index 0e63fa167..558cb7b20 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/AllWidgetsFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/AllWidgetsFormTest.java @@ -17,6 +17,7 @@ import net.bytebuddy.utility.RandomString; +import org.bcss.collect.android.R; import org.hamcrest.Matcher; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/GuidanceHintFormTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/GuidanceHintFormTest.java index f29dc5c29..aa80ee9b9 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/GuidanceHintFormTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/GuidanceHintFormTest.java @@ -6,6 +6,7 @@ import androidx.test.rule.ActivityTestRule; import androidx.test.rule.GrantPermissionRule; +import org.bcss.collect.android.R; import org.javarosa.form.api.FormEntryPrompt; import org.junit.AfterClass; import org.junit.Before; diff --git a/collect_app/src/androidTest/java/org/odk/collect/android/database/helpers/FormsDatabaseHelperTest.java b/collect_app/src/androidTest/java/org/odk/collect/android/database/helpers/FormsDatabaseHelperTest.java index f6e8f9e24..71dfac702 100644 --- a/collect_app/src/androidTest/java/org/odk/collect/android/database/helpers/FormsDatabaseHelperTest.java +++ b/collect_app/src/androidTest/java/org/odk/collect/android/database/helpers/FormsDatabaseHelperTest.java @@ -61,23 +61,6 @@ public static Iterable data() { }); } - @Test - public void testMigration() throws IOException { - copyFileFromAssets("database" + File.separator + dbFilename, DATABASE_PATH); - FormsDatabaseHelper databaseHelper = new FormsDatabaseHelper(); - ensureMigrationAppliesFully(databaseHelper); - - SQLiteDatabase db = databaseHelper.getReadableDatabase(); - assertThat(db.getVersion(), is(FormsDatabaseHelper.DATABASE_VERSION)); - - List newColumnNames = SQLiteUtils.getColumnNames(db, FORMS_TABLE_NAME); - - assertThat(newColumnNames, contains(FormsDatabaseHelper.CURRENT_VERSION_COLUMN_NAMES)); - - if (action.equals(UPGRADE)) { - assertThatFormsAreKeptAfterUpgrading(); - } - } private void assertThatFormsAreKeptAfterUpgrading() { FormsDao formsDao = new FormsDao(); diff --git a/collect_app/src/main/java/org/odk/collect/android/database/helpers/FormsDatabaseHelper.java b/collect_app/src/main/java/org/odk/collect/android/database/helpers/FormsDatabaseHelper.java index b8ea6aef4..af56b2bf2 100644 --- a/collect_app/src/main/java/org/odk/collect/android/database/helpers/FormsDatabaseHelper.java +++ b/collect_app/src/main/java/org/odk/collect/android/database/helpers/FormsDatabaseHelper.java @@ -55,7 +55,7 @@ public class FormsDatabaseHelper extends SQLiteOpenHelper { public static final String FORMS_TABLE_NAME = "forms"; public static final String DATABASE_PATH = Collect.METADATA_PATH + File.separator + DATABASE_NAME; - private static final int DATABASE_VERSION = 8; + public static final int DATABASE_VERSION = 8; // These exist in database versions 2 and 3, but not in 4... private static final String TEMP_FORMS_TABLE_NAME = "forms_v4";