Renamed AppTable to AppMetadataTable

See #511 for details. This is in prepration for having an even more normalized
`fdroid_package` table. That table will be the authoritative reference of what
"packages" are known about in the client. The "app" table (now thought of as "app metadata") will
be specific to each repository which provides different metadata about that app.
This commit is contained in:
Peter Serwylo committed 2016-08-11 16:34:26 +10:00
1 parent 2837a235b4
commit 626f55b43b
13 files changed
+106 -106

No files matched your search

@@ -12,7 +12,7 @@ import org.fdroid.fdroid.data.App;
import org.fdroid.fdroid.data.AppProvider;
import org.fdroid.fdroid.data.InstalledAppProvider;
import org.fdroid.fdroid.data.Schema.ApkTable;
import org.fdroid.fdroid.data.Schema.AppTable;
import org.fdroid.fdroid.data.Schema.AppMetadataTable;
import org.fdroid.fdroid.data.Schema.InstalledAppTable;
import org.robolectric.shadows.ShadowContentResolver;
@@ -183,14 +183,14 @@ public class Assert {
public static App insertApp(Context context, String packageName, String name, ContentValues additionalValues) {
ContentValues values = new ContentValues();
values.put(AppTable.Cols.PACKAGE_NAME, packageName);
values.put(AppTable.Cols.NAME, name);
values.put(AppMetadataTable.Cols.PACKAGE_NAME, packageName);
values.put(AppMetadataTable.Cols.NAME, name);
// Required fields (NOT NULL in the database).
values.put(AppTable.Cols.SUMMARY, "test summary");
values.put(AppTable.Cols.DESCRIPTION, "test description");
values.put(AppTable.Cols.LICENSE, "GPL?");
values.put(AppTable.Cols.IS_COMPATIBLE, 1);
values.put(AppMetadataTable.Cols.SUMMARY, "test summary");
values.put(AppMetadataTable.Cols.DESCRIPTION, "test description");
values.put(AppMetadataTable.Cols.LICENSE, "GPL?");
values.put(AppMetadataTable.Cols.IS_COMPATIBLE, 1);
values.putAll(additionalValues);
@@ -8,7 +8,7 @@ import android.net.Uri;
import org.fdroid.fdroid.BuildConfig;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.data.Schema.AppTable.Cols;
import org.fdroid.fdroid.data.Schema.AppMetadataTable.Cols;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -82,7 +82,7 @@ public class ProviderUriTests {
@Test
public void validAppProviderUris() {
ShadowContentResolver.registerProvider(AppProvider.getAuthority(), new AppProvider());
String[] projection = new String[] {Schema.AppTable.Cols._ID};
String[] projection = new String[] {Schema.AppMetadataTable.Cols._ID};
assertValidUri(resolver, AppProvider.getContentUri(), "content://org.fdroid.fdroid.data.AppProvider", projection);
assertValidUri(resolver, AppProvider.getSearchUri("'searching!'"), "content://org.fdroid.fdroid.data.AppProvider/search/'searching!'", projection);
assertValidUri(resolver, AppProvider.getSearchUri("/"), "content://org.fdroid.fdroid.data.AppProvider/search/%2F", projection);
@@ -102,7 +102,7 @@ public class ProviderUriTests {
@Test
public void validTempAppProviderUris() {
ShadowContentResolver.registerProvider(TempAppProvider.getAuthority(), new TempAppProvider());
String[] projection = new String[]{Schema.AppTable.Cols._ID};
String[] projection = new String[]{Schema.AppMetadataTable.Cols._ID};
// Required so that the `assertValidUri` calls below will indeed have a real temp_fdroid_app
// table to query.