diff options
Diffstat (limited to 'OpenKeychain/src/test/java/org')
14 files changed, 84 insertions, 57 deletions
diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/WorkaroundBuildConfig.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/WorkaroundBuildConfig.java new file mode 100644 index 000000000..5f1a20fe9 --- /dev/null +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/WorkaroundBuildConfig.java @@ -0,0 +1,16 @@ +package org.sufficientlysecure.keychain; + +import org.sufficientlysecure.keychain.BuildConfig; + +/** + * Temporary workaround for https://github.com/robolectric/robolectric/issues/1747 + */ +public final class WorkaroundBuildConfig { + public static final boolean DEBUG = BuildConfig.DEBUG; + // Workaround: Use real packageName not applicationId + public static final String APPLICATION_ID = "org.sufficientlysecure.keychain"; + public static final String BUILD_TYPE = BuildConfig.BUILD_TYPE; + public static final String FLAVOR = BuildConfig.FLAVOR; + public static final int VERSION_CODE = BuildConfig.VERSION_CODE; + public static final String VERSION_NAME = BuildConfig.VERSION_NAME; +} diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/CertifyOperationTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/CertifyOperationTest.java index a2b1cfdc0..6984f126e 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/CertifyOperationTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/CertifyOperationTest.java @@ -29,6 +29,7 @@ import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.CertifyResult; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; @@ -54,7 +55,7 @@ import java.util.ArrayList; import java.util.Random; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class CertifyOperationTest { static UncachedKeyRing mStaticRing1, mStaticRing2; diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/ExportTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/ExportTest.java index 4467d4042..a659dc7da 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/ExportTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/ExportTest.java @@ -22,16 +22,18 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.Robolectric; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; -import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; +import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; import org.sufficientlysecure.keychain.operations.results.ExportResult; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; import org.sufficientlysecure.keychain.pgp.PgpKeyOperation; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing.IteratorWithIOThrow; @@ -51,7 +53,7 @@ import java.security.Security; import java.util.Iterator; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class ExportTest { static Passphrase mPassphrase = TestingUtils.genPassphrase(true); diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/PromoteKeyOperationTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/PromoteKeyOperationTest.java index 64de447f9..a4854d7b9 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/PromoteKeyOperationTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/operations/PromoteKeyOperationTest.java @@ -18,6 +18,10 @@ package org.sufficientlysecure.keychain.operations; +import java.io.PrintStream; +import java.security.Security; +import java.util.Iterator; + import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; @@ -30,7 +34,7 @@ import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.util.encoders.Hex; -import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; import org.sufficientlysecure.keychain.operations.results.PromoteKeyResult; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey; @@ -50,12 +54,8 @@ import org.sufficientlysecure.keychain.util.Passphrase; import org.sufficientlysecure.keychain.util.ProgressScaler; import org.sufficientlysecure.keychain.util.TestingUtils; -import java.io.PrintStream; -import java.security.Security; -import java.util.Iterator; - @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class PromoteKeyOperationTest { static UncachedKeyRing mStaticRing; diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/KeyRingTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/KeyRingTest.java index d93081fd9..64316b2a6 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/KeyRingTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/KeyRingTest.java @@ -21,12 +21,13 @@ import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class KeyRingTest { @Test diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java index c6f222e69..39230df0e 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java @@ -18,6 +18,14 @@ package org.sufficientlysecure.keychain.pgp; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.security.Security; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; + import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; @@ -36,7 +44,7 @@ import org.spongycastle.bcpg.PublicKeyEncSessionPacket; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.openpgp.PGPEncryptedData; -import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.DecryptVerifyResult; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; @@ -55,21 +63,12 @@ import org.sufficientlysecure.keychain.util.Passphrase; import org.sufficientlysecure.keychain.util.ProgressScaler; import org.sufficientlysecure.keychain.util.TestingUtils; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.security.Security; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; - import static org.hamcrest.core.AnyOf.anyOf; import static org.hamcrest.core.Is.is; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class PgpEncryptDecryptTest { static Passphrase mPassphrase = TestingUtils.genPassphrase(true); diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java index 2506f1630..c0e28cd4b 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java @@ -21,11 +21,11 @@ package org.sufficientlysecure.keychain.pgp; import junit.framework.AssertionFailedError; import org.junit.Assert; +import org.junit.Test; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.*; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.BCPGInputStream; @@ -41,7 +41,7 @@ import org.spongycastle.bcpg.UserIDPacket; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.openpgp.PGPSignature; -import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; @@ -73,8 +73,7 @@ import java.util.List; import java.util.Random; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class PgpKeyOperationTest { static UncachedKeyRing staticRing; diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java index b37efc031..ad4c1fb75 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java @@ -18,12 +18,13 @@ package org.sufficientlysecure.keychain.pgp; -import org.junit.Assert; -import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Test; import org.junit.runner.RunWith; +import org.junit.Assert; +import org.junit.Test; +import org.junit.Before; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.BCPGInputStream; @@ -54,12 +55,13 @@ import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder; import org.spongycastle.util.Strings; import org.sufficientlysecure.keychain.BuildConfig; import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.OperationResult; -import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; -import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Algorithm; +import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType; +import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.service.SaveKeyringParcel.ChangeUnlockParcel; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.support.KeyringTestingHelper; @@ -81,8 +83,7 @@ import java.util.Iterator; */ @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class UncachedKeyringCanonicalizeTest { static UncachedKeyRing staticRing; diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java index a08ed2c79..cc5c487bd 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringMergeTest.java @@ -24,6 +24,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.BCPGInputStream; @@ -34,9 +35,10 @@ import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.jce.provider.BouncyCastleProvider; import org.spongycastle.util.Strings; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.OperationResult; -import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; +import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; import org.sufficientlysecure.keychain.pgp.PgpCertifyOperation.PgpCertifyResult; import org.sufficientlysecure.keychain.service.CertifyActionsParcel.CertifyAction; import org.sufficientlysecure.keychain.service.SaveKeyringParcel; @@ -80,8 +82,7 @@ import java.util.Random; * */ @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class UncachedKeyringMergeTest { static UncachedKeyRing staticRingA, staticRingB; diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringTest.java index 1097c9e89..e946acf01 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringTest.java @@ -24,10 +24,12 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.sig.KeyFlags; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.operations.results.PgpEditKeyResult; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing.IteratorWithIOThrow; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; @@ -43,8 +45,7 @@ import java.util.Iterator; import java.util.Random; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class UncachedKeyringTest { static UncachedKeyRing staticRing, staticPubRing; diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperKeyringTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperKeyringTest.java index 32fb68ea6..6779784a2 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperKeyringTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperKeyringTest.java @@ -17,23 +17,22 @@ package org.sufficientlysecure.keychain.provider; +import java.util.Collections; +import java.util.Arrays; +import java.util.Collection; +import java.util.ArrayList; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.RobolectricGradleTestRunner; -import org.robolectric.RuntimeEnvironment; +import org.robolectric.*; import org.robolectric.annotation.Config; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.support.KeyringTestingHelper; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class ProviderHelperKeyringTest { @Test diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java index 5fa7fb36d..04851ebbb 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java @@ -22,20 +22,23 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.Robolectric; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.bcpg.sig.KeyFlags; import org.spongycastle.util.encoders.Hex; import org.sufficientlysecure.keychain.BuildConfig; -import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; -import org.sufficientlysecure.keychain.operations.results.SaveKeyringResult; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.pgp.CanonicalizedPublicKeyRing; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey.SecretKeyType; import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; +import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog; +import org.sufficientlysecure.keychain.operations.results.SaveKeyringResult; import org.sufficientlysecure.keychain.util.IterableIterator; import org.sufficientlysecure.keychain.util.ProgressScaler; @@ -43,8 +46,7 @@ import java.util.Arrays; import java.util.Iterator; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class ProviderHelperSaveTest { ProviderHelper mProviderHelper = new ProviderHelper(RuntimeEnvironment.application); diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java index 7a93a54d3..f6888588e 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/Iso7816TLVTest.java @@ -20,15 +20,16 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.spongycastle.util.encoders.Hex; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.util.Iso7816TLV.Iso7816CompositeTLV; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class Iso7816TLVTest { @Before diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/ParcelableFileCacheTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/ParcelableFileCacheTest.java index e049bf2cc..7b97ebdae 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/ParcelableFileCacheTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/util/ParcelableFileCacheTest.java @@ -24,18 +24,22 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.Robolectric; import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowLog; import org.sufficientlysecure.keychain.BuildConfig; +import org.sufficientlysecure.keychain.WorkaroundBuildConfig; import org.sufficientlysecure.keychain.util.ParcelableFileCache.IteratorWithSize; import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; @RunWith(RobolectricGradleTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml", - packageName = "org.sufficientlysecure.keychain") +@Config(constants = WorkaroundBuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml") public class ParcelableFileCacheTest { @Before |