diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-06-24 20:16:46 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-06-24 20:16:46 +0200 |
commit | 9ce7d29a2d2769e9ee8d7838d60bbb19ce77907d (patch) | |
tree | 56dea21f9a088c26933089aa3d4f279295c0b01b /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java | |
parent | e84aa5a69d0d6f17699ed2af2bcb0561b31ac90d (diff) | |
parent | 109f74a922ec046ba6e8eb171942cbbda3db25ab (diff) | |
download | open-keychain-9ce7d29a2d2769e9ee8d7838d60bbb19ce77907d.tar.gz open-keychain-9ce7d29a2d2769e9ee8d7838d60bbb19ce77907d.tar.bz2 open-keychain-9ce7d29a2d2769e9ee8d7838d60bbb19ce77907d.zip |
Merge submodules
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java index d4bc6c541..a565f0707 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/KeyringTestingHelper.java @@ -5,9 +5,10 @@ import android.content.Context; import org.sufficientlysecure.keychain.pgp.NullProgressable; import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.remote.AppSettings; import org.sufficientlysecure.keychain.service.OperationResults; +import java.util.Collection; + /** * Helper for tests of the Keyring import in ProviderHelper. */ @@ -19,13 +20,11 @@ public class KeyringTestingHelper { this.context = robolectricContext; } - public boolean addKeyring() throws Exception { + public boolean addKeyring(Collection<String> blobFiles) throws Exception { ProviderHelper providerHelper = new ProviderHelper(context); -// providerHelper.insertApiApp(new AppSettings("robo-test-package", new byte[]{5, 4, 3, 2, 1})); - - byte[] data = TestDataUtil.readFully(getClass().getResourceAsStream("/public-key-for-sample.blob")); + byte[] data = TestDataUtil.readAllFully(blobFiles); UncachedKeyRing ring = UncachedKeyRing.decodeFromData(data); long masterKeyId = ring.getMasterKeyId(); @@ -45,6 +44,7 @@ public class KeyringTestingHelper { return saveSuccess; } + private void retrieveKeyAndExpectNotFound(ProviderHelper providerHelper, long masterKeyId) { try { providerHelper.getWrappedPublicKeyRing(masterKeyId); |