add 'debug' to applicationId and versionName for debug builds
This commit is contained in:
parent
4265b45f18
commit
427d0d0aa0
@ -229,6 +229,14 @@ android {
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
applicationIdSuffix ".debug"
|
||||
resValue "string", "applicationId", defaultConfig.applicationId + applicationIdSuffix
|
||||
versionNameSuffix "-debug"
|
||||
}
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests {
|
||||
// prevent tests from dying on android.util.Log calls
|
||||
|
@ -25,6 +25,11 @@ import static org.fdroid.fdroid.Assert.assertValidUri;
|
||||
@SuppressWarnings("LineLength")
|
||||
public class ProviderUriTests {
|
||||
|
||||
private static final String CONTENT_URI_BASE = "content://" + FDroidProvider.AUTHORITY;
|
||||
private static final String APK_PROVIDER_URI_BASE = CONTENT_URI_BASE + ".ApkProvider";
|
||||
private static final String APP_PROVIDER_URI_BASE = CONTENT_URI_BASE + ".AppProvider";
|
||||
private static final String TEMP_APP_PROVIDER_URI_BASE = CONTENT_URI_BASE + ".TempAppProvider";
|
||||
|
||||
private ShadowContentResolver resolver;
|
||||
|
||||
@Before
|
||||
@ -83,24 +88,25 @@ public class ProviderUriTests {
|
||||
public void validAppProviderUris() {
|
||||
TestUtils.registerContentProvider(AppProvider.getAuthority(), AppProvider.class);
|
||||
String[] projection = new String[]{Schema.AppMetadataTable.Cols._ID};
|
||||
assertValidUri(resolver, AppProvider.getContentUri(), "content://org.fdroid.fdroid.data.AppProvider", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("'searching!'", null), "content://org.fdroid.fdroid.data.AppProvider/search/'searching!'", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("'searching!'", "Games"), "content://org.fdroid.fdroid.data.AppProvider/search/'searching!'/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("/", null), "content://org.fdroid.fdroid.data.AppProvider/search/%2F", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("/", "Games"), "content://org.fdroid.fdroid.data.AppProvider/search/%2F/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("", null), "content://org.fdroid.fdroid.data.AppProvider", projection);
|
||||
assertValidUri(resolver, AppProvider.getCategoryUri("Games"), "content://org.fdroid.fdroid.data.AppProvider/category/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("", "Games"), "content://org.fdroid.fdroid.data.AppProvider/category/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri((String) null, null), "content://org.fdroid.fdroid.data.AppProvider", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri((String) null, "Games"), "content://org.fdroid.fdroid.data.AppProvider/category/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getInstalledUri(), "content://org.fdroid.fdroid.data.AppProvider/installed", projection);
|
||||
assertValidUri(resolver, AppProvider.getCanUpdateUri(), "content://org.fdroid.fdroid.data.AppProvider/canUpdate", projection);
|
||||
assertValidUri(resolver, AppProvider.getContentUri(), APP_PROVIDER_URI_BASE, projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("'searching!'", null), APP_PROVIDER_URI_BASE + "/search/'searching!'", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("'searching!'", "Games"), APP_PROVIDER_URI_BASE + "/search/'searching!'/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("/", null), APP_PROVIDER_URI_BASE + "/search/%2F", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("/", "Games"), APP_PROVIDER_URI_BASE + "/search/%2F/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("", null), APP_PROVIDER_URI_BASE, projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri("", "Games"), APP_PROVIDER_URI_BASE + "/category/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getCategoryUri("Games"), APP_PROVIDER_URI_BASE + "/category/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri((String) null, null), APP_PROVIDER_URI_BASE, projection);
|
||||
assertValidUri(resolver, AppProvider.getSearchUri((String) null, "Games"), APP_PROVIDER_URI_BASE + "/category/Games", projection);
|
||||
assertValidUri(resolver, AppProvider.getInstalledUri(), APP_PROVIDER_URI_BASE + "/installed", projection);
|
||||
assertValidUri(resolver, AppProvider.getCanUpdateUri(), APP_PROVIDER_URI_BASE + "/canUpdate", projection);
|
||||
|
||||
App app = new App();
|
||||
app.repoId = 1;
|
||||
app.packageName = "org.fdroid.fdroid";
|
||||
|
||||
assertValidUri(resolver, AppProvider.getSpecificAppUri(app.packageName, app.repoId), "content://org.fdroid.fdroid.data.AppProvider/app/1/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, AppProvider.getSpecificAppUri(app.packageName, app.repoId),
|
||||
APP_PROVIDER_URI_BASE + "/app/1/org.fdroid.fdroid", projection);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -116,8 +122,9 @@ public class ProviderUriTests {
|
||||
packageNames.add("org.fdroid.fdroid");
|
||||
packageNames.add("com.example.com");
|
||||
|
||||
assertValidUri(resolver, TempAppProvider.getAppsUri(packageNames, 1), "content://org.fdroid.fdroid.data.TempAppProvider/apps/1/org.fdroid.fdroid%2Ccom.example.com", projection);
|
||||
assertValidUri(resolver, TempAppProvider.getContentUri(), "content://org.fdroid.fdroid.data.TempAppProvider", projection);
|
||||
assertValidUri(resolver, TempAppProvider.getAppsUri(packageNames, 1),
|
||||
TEMP_APP_PROVIDER_URI_BASE + "/apps/1/org.fdroid.fdroid%2Ccom.example.com", projection);
|
||||
assertValidUri(resolver, TempAppProvider.getContentUri(), TEMP_APP_PROVIDER_URI_BASE, projection);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -137,10 +144,15 @@ public class ProviderUriTests {
|
||||
apks.add(new MockApk("com.example." + i, i));
|
||||
}
|
||||
|
||||
assertValidUri(resolver, ApkProvider.getContentUri(), "content://org.fdroid.fdroid.data.ApkProvider", projection);
|
||||
assertValidUri(resolver, ApkProvider.getAppUri("org.fdroid.fdroid"), "content://org.fdroid.fdroid.data.ApkProvider/app/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, ApkProvider.getApkFromAnyRepoUri(new MockApk("org.fdroid.fdroid", 100)), "content://org.fdroid.fdroid.data.ApkProvider/apk-any-repo/100/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, ApkProvider.getApkFromAnyRepoUri("org.fdroid.fdroid", 100, null), "content://org.fdroid.fdroid.data.ApkProvider/apk-any-repo/100/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, ApkProvider.getRepoUri(1000), "content://org.fdroid.fdroid.data.ApkProvider/repo/1000", projection);
|
||||
assertValidUri(resolver, ApkProvider.getContentUri(),
|
||||
APK_PROVIDER_URI_BASE, projection);
|
||||
assertValidUri(resolver, ApkProvider.getAppUri("org.fdroid.fdroid"),
|
||||
APK_PROVIDER_URI_BASE + "/app/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, ApkProvider.getApkFromAnyRepoUri(new MockApk("org.fdroid.fdroid", 100)),
|
||||
APK_PROVIDER_URI_BASE + "/apk-any-repo/100/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, ApkProvider.getApkFromAnyRepoUri("org.fdroid.fdroid", 100, null),
|
||||
APK_PROVIDER_URI_BASE + "/apk-any-repo/100/org.fdroid.fdroid", projection);
|
||||
assertValidUri(resolver, ApkProvider.getRepoUri(1000),
|
||||
APK_PROVIDER_URI_BASE + "/repo/1000", projection);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user