summaryrefslogtreecommitdiff
path: root/keystore/tests
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2013-02-04 14:47:23 -0800
committerKenny Root <kroot@google.com>2013-02-04 14:52:23 -0800
commit8b58c52bf4cc276165b1857eb4087eabde7b6477 (patch)
tree448c4ff3315e2fc1a9c4d910c749eda002c7ce57 /keystore/tests
parentace72f6a37ffc232172346b3385494ef10195583 (diff)
AndroidKeyStore: fix tests
Change-Id: I65fd8ba27af57ea8fd27c8e08c9c1201f32c494d
Diffstat (limited to 'keystore/tests')
-rw-r--r--keystore/tests/src/android/security/AndroidKeyStoreTest.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/keystore/tests/src/android/security/AndroidKeyStoreTest.java b/keystore/tests/src/android/security/AndroidKeyStoreTest.java
index 49e2f1289ae7..056e6813fc91 100644
--- a/keystore/tests/src/android/security/AndroidKeyStoreTest.java
+++ b/keystore/tests/src/android/security/AndroidKeyStoreTest.java
@@ -577,17 +577,14 @@ public class AndroidKeyStoreTest extends AndroidTestCase {
assertAliases(new String[] { });
}
- public void testKeyStore_DeleteEntry_EmptyStore_Failure() throws Exception {
+ public void testKeyStore_DeleteEntry_EmptyStore_Success() throws Exception {
mKeyStore.load(null, null);
- try {
- mKeyStore.deleteEntry(TEST_ALIAS_1);
- fail("Should throw KeyStoreException with non-existent alias");
- } catch (KeyStoreException success) {
- }
+ // Should not throw when a non-existent entry is requested for delete.
+ mKeyStore.deleteEntry(TEST_ALIAS_1);
}
- public void testKeyStore_DeleteEntry_NonExistent_Failure() throws Exception {
+ public void testKeyStore_DeleteEntry_NonExistent_Success() throws Exception {
mKeyStore.load(null, null);
// TEST_ALIAS_1
@@ -596,11 +593,8 @@ public class AndroidKeyStoreTest extends AndroidTestCase {
assertTrue(mAndroidKeyStore.put(Credentials.USER_CERTIFICATE + TEST_ALIAS_1, FAKE_USER_1));
assertTrue(mAndroidKeyStore.put(Credentials.CA_CERTIFICATE + TEST_ALIAS_1, FAKE_CA_1));
- try {
- mKeyStore.deleteEntry(TEST_ALIAS_2);
- fail("Should throw KeyStoreException with non-existent alias");
- } catch (KeyStoreException success) {
- }
+ // Should not throw when a non-existent entry is requested for delete.
+ mKeyStore.deleteEntry(TEST_ALIAS_2);
}
public void testKeyStore_GetCertificate_Single_Success() throws Exception {