mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-09 06:31:08 +01:00
smack-omemo*: Do not swallow IOException deep within the library
Those exception are caused by I/O operations in the OmemoStore, which is now declaring that it throws those (since it is not uncommon for I/O operations to cause IOExceptions). After all, this is nicely demonstrated as this change is caused by switching with this commit to the Android API 19 compatible methods in FileBasedOmemoStore, which throw. The library can not decide what to do in case of those exceptions, hence it is sensible to expose them to the user.
This commit is contained in:
parent
699905a1de
commit
1bce378e6d
16 changed files with 299 additions and 331 deletions
|
|
@ -302,20 +302,20 @@ public abstract class OmemoStoreTest<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey
|
|||
}
|
||||
|
||||
@Test
|
||||
public void loadAllRawSessionsReturnsEmptyMapTest() {
|
||||
public void loadAllRawSessionsReturnsEmptyMapTest() throws IOException {
|
||||
HashMap<Integer, T_Sess> sessions = store.loadAllRawSessionsOf(alice, bob.getJid());
|
||||
assertNotNull(sessions);
|
||||
assertEquals(0, sessions.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loadNonExistentRawSessionReturnsNullTest() {
|
||||
public void loadNonExistentRawSessionReturnsNullTest() throws IOException {
|
||||
T_Sess session = store.loadRawSession(alice, bob);
|
||||
assertNull(session);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loadStoreMessageCounterTest() {
|
||||
public void loadStoreMessageCounterTest() throws IOException {
|
||||
assertEquals(0, store.loadOmemoMessageCounter(alice, bob));
|
||||
store.storeOmemoMessageCounter(alice, bob, 20);
|
||||
assertEquals(20, store.loadOmemoMessageCounter(alice, bob));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue